DATA ANALYSIS
显示 更早的评论
Hi,
I have a problem which is outlined below:-
x = 1:5;
y = 1:5;
t = -1:1/2:1;
u = 0:1/2:2;
I then calculate
for i = 1:5
z = y(:,i) - ( t(:,i) + ( u .* x(:,i) ) )
end
This then yields
z =
2.0000 1.5000 1.0000 0.5000 0
z =
2.5000 1.5000 0.5000 -0.5000 -1.5000
z =
3.0000 1.5000 0 -1.5000 -3.0000
z =
3.5000 1.5000 -0.5000 -2.5000 -4.5000
z =
4.0000 1.5000 -1.0000 -3.5000 -6.0000
I would like it to output in the form
z =
Columns 1 through 8
2.0000 1.5000 1.0000 0.5000 0 2.5000 1.5000 0.5000
Columns 9 through 16
-0.5000 -1.5000 3.0000 1.5000 0 -1.5000 -3.0000 3.5000
Columns 17 through 24
1.5000 -0.5000 -2.5000 -4.5000 4.0000 1.5000 -1.0000 -3.5000
Column 25
-6.0000
Is this possible please?
Any help would be greatly appreciated
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!