Help with matrix creation
古いコメントを表示
I am trying to create a matrix based on A = [1,z(j),z(j)^2,z(j)^3] where j = 1:41 and z(j) = (j-1)/10. I got the for loop working for creating the vector z(j) but I cannot get matlab to create the 41X4 A matrix that I need. Help me please!!!
回答 (2 件)
Walter Roberson
2020 年 2 月 2 日
A = [ones(size(j));z;z.^2;z.^3].'
Pavel Osipov
2020 年 2 月 2 日
0 投票
>> j = 1:41; z(j) = (j-1)/10;
>> lenZ=length(z);
>> AA=[ones(lenZ,1), z',(z.^2)',(z.^3)'];

I'm hope, it's usefool for you.

カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!