Missing a Display command? Wrong syntax?
조회 수: 1 (최근 30일)
이전 댓글 표시
I'm trying to get the values of n in a column and the value of W a column next to it with titles, am i missing something somewhere?
clear format bank N=input('Please enter a value of n: ');
W = zeros(N,1) ; W(1) = 25 ; for n = 2:N W(n) = (W(n-1) +7) -(7*n/(n-1)) ; end disp(' N Wn ') disp (n),(W)
댓글 수: 0
채택된 답변
KSSV
2017년 3월 30일
N=input('Please enter a value of n: ');
W = zeros(N,1) ;
W(1) = 25 ;
for n = 2:N
W(n) = (W(n-1) +7) -(7*n/(n-1)) ;
end
T = table ;
T.n = [1:N]' ;
T.W = W ;
T
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Whos에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!