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

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site