write the following program using matlab

2 views (last 30 days)
VIVEK SINGH
VIVEK SINGH on 30 Nov 2020
Commented: VIVEK SINGH on 30 Nov 2020

Answers (1)

amin
amin on 30 Nov 2020
Hi Vivek,
Odd positions are integers from 1 to 50 and they go to the first column of A.
The even positions are the third power of the previous position and they go to the second column of A.
A(:,1)=1:50;
A(:,2)=A(:,1).^3;
plot(A(:,1),A(:,2))
legend('Second column against first column')
  2 Comments
VIVEK SINGH
VIVEK SINGH on 30 Nov 2020
thank you so much sir for your kind help

Sign in to comment.

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!