Have a problem about code
5 次查看(过去 30 天)
显示 更早的评论
I'm new in matlab and I have a problem below
Cs=[0.15:0.15:0.45];
Cx=0.12;
C0= 0.08;
Erf=(Cs-Cx)/(Cs-C0)
Why Erf answer have only 1 answer, it should have 9 answers?
2 个评论
DGM
2021-10-3
编辑:DGM
2021-10-3
Why would it have 9 elements? If you use elementwise division instead of matrix division, it'll have 3.
Cs = 0.15:0.15:0.45;
Cx = 0.12;
C0 = 0.08;
Erf = (Cs-Cx)./(Cs-C0)
If you transpose one of the vectors, you can get 9, but I don't know if that's intended.
Erf = (Cs-Cx)./(Cs.'-C0)
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!