How do I let a initial vector change depending on input?
조회 수: 13 (최근 30일)
이전 댓글 표시
I want to display a table for error solutions to a Hilbert matrix n=5-13. I initialized a ones vector but it will not accept a change in size even inside a for loop. Here is a sample of my code:
function T=object(n)
for i=1:length(n)
A=hilb(n(i));
x_true=ones(n(i),1);
b=A.*x_true;
%List of variables for the table. Reiterate to avoid overwriting.
n=n(i);
for j=1:length(n)
var1=something
end
for j=1:length(n)
var2=something
end
for j=1:length(n)
var3=something
end
T=table(n,var1,var2,var3);
summary(T)
end
end
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!