output

1 view (last 30 days)
r?za çay
r?za çay on 9 Dec 2011
for example my output: 20 30 40 50 I want to convert ---------------> A(0)=20 <--------------- A(1)=30 A(2)=40 A(3)=50 how can I make this??

Accepted Answer

Walter Roberson
Walter Roberson on 9 Dec 2011
A = [20 30 40 50];
fprintf(1, 'A(%d)=%d ', [(0:length(A)-1).' ; A(:)].' );
fprintf(1, '\n');
  5 Comments
r?za çay
r?za çay on 11 Dec 2011
ohhhh Paulo this program work well. very thanks Paulo and Walter:))

Sign in to comment.

More Answers (1)

Paulo Silva
Paulo Silva on 9 Dec 2011
A=[20 30 40 50]
MATLAB index values start at 1 not 0
  2 Comments
Paulo Silva
Paulo Silva on 10 Dec 2011
I'm always using old versions but will upgrade soon, both MATLAB version and Mind Reading Toolbox ;)

Sign in to comment.

Categories

Find more on Dates and Time in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by