how to make matrix
显示 更早的评论
F = zeros(20,1);
F(1:4) = 3.3;
F(5:7) = 4.2;
F(8:10) = 1.8;
F(11:13) = 6.9;
F(14:17) = 4.3;
F(18:20) = 4.1;
how do i take these and put it into the matrix
3 个评论
DGM
2022-11-26
What exactly do you want? The given code will give you a 20x1 vector. There isn't a clear pattern to the vector generation. It's just some arbitrary blocks of some arbitrary constants. If you want to programmatically generate something, it's up to you to describe the inputs and outputs.
John D'Errico
2022-11-26
Those numbers are already in a matrix, a 20x1 matrix, usually called a vector, but still a matrix too. So exactly what do you want?
poppy
2022-11-26
回答(1 个)
F = zeros(20,1);
F(1:4) = 3.3;
F(5:7) = 4.2;
F(8:10) = 1.8;
F(11:13) = 6.9;
F(14:17) = 4.3;
F(18:20) = 4.1;
table(F)
fprintf('%.1f\n', F)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!