필터 지우기
필터 지우기

output

조회 수: 3 (최근 30일)
r?za çay
r?za çay 2011년 12월 9일
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??

채택된 답변

Walter Roberson
Walter Roberson 2011년 12월 9일
A = [20 30 40 50];
fprintf(1, 'A(%d)=%d ', [(0:length(A)-1).' ; A(:)].' );
fprintf(1, '\n');
  댓글 수: 5
Walter Roberson
Walter Roberson 2011년 12월 10일
Hmmm... I did test at the time I posted.
Did you perhaps omit the ".'" after the [] ?
r?za çay
r?za çay 2011년 12월 11일
ohhhh Paulo this program work well. very thanks Paulo and Walter:))

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Paulo Silva
Paulo Silva 2011년 12월 9일
A=[20 30 40 50]
MATLAB index values start at 1 not 0
  댓글 수: 2
Walter Roberson
Walter Roberson 2011년 12월 9일
Paulo, did you not upgrade to the Purple Agate beta of the Mind Reading Toolbox ? "It assists in allowing trust with your own intuition and opens the spiritual flood gates to a realm of endless possibilities." Are you still using the Amber beta ?
Paulo Silva
Paulo Silva 2011년 12월 10일
I'm always using old versions but will upgrade soon, both MATLAB version and Mind Reading Toolbox ;)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by