Write a matlab script to generate a vector where each value
Write a matlab script to generate a vector where each value increases by 3 (i.e., a=[0 3 6 9]). You must preallocate memory in code before running the code. Upload your m-file.
Solution
%PROGRAM TO GENEARTE A VECTOR WHIOSE VALUE INCREASES BY 3
clc
clear all
n=input(\'n value=\');
A = [0:3:n];
disp(A)
![Write a matlab script to generate a vector where each value increases by 3 (i.e., a=[0 3 6 9]). You must preallocate memory in code before running the code. Up Write a matlab script to generate a vector where each value increases by 3 (i.e., a=[0 3 6 9]). You must preallocate memory in code before running the code. Up](/WebImages/31/write-a-matlab-script-to-generate-a-vector-where-each-value-1088668-1761572852-0.webp)