Inputs must be 2-D, or at least one input must be scalar
7 次查看(过去 30 天)
显示 更早的评论
Hello
I want to write the following codes in MATLAB, but I encounter a problem like as following
[H1,c,ms,path]=mytopo(topo);
[l,r,route]=size(H1);
maxc=max(c);
z1=(maxc/r)*ones(r,1);
y=H1*z1;
Note: H1 is 3d matrix. When I want to run the program, the following error occurs:
Error using
Inputs must be 2-D, or at least one input must be scalar.
To compute elementwise TIMES, use TIMES (.*) instead.
Error in Dtrump
y=H1*z1;
Cheers
0 个评论
采纳的回答
Azzi Abdelmalek
2016-7-26
编辑:Azzi Abdelmalek
2016-7-26
Maybe you want
bsxfun(@times,H1,z1)
I guess z1 is a vector
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!