Help with matrix creation
1 次查看(过去 30 天)
显示 更早的评论
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!!!
0 个评论
回答(2 个)
Pavel Osipov
2020-2-2
>> j = 1:41; z(j) = (j-1)/10;
>> lenZ=length(z);
>> AA=[ones(lenZ,1), z',(z.^2)',(z.^3)'];
![z.JPG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/269455/z.jpeg)
I'm hope, it's usefool for you.![A.JPG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/269456/A.jpeg)
![A.JPG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/269456/A.jpeg)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!