Dimensions do not agree??

1 次查看(过去 30 天)
Kevin
Kevin 2014-7-9
回答: Mads 2014-7-9
Hi,
I have the following equation in Matlab:
F=(2/3.14)*ACos(exp(-(((B/2)*(1-(X)))/((X)*sin(Phi)))));
where
X =
0.1111
0.2222
0.3333
0.4444
0.5556
0.6667
0.7778
0.8889
1.0000
and
Phi =
0.7684
0.5628
0.4290
0.3416
0.2819
0.2392
0.2073
0.1828
0.1633
but when I run the code I am promted to say that my matrix inner dimensions must agree to solve this equation. Can anybody please help me with this?
Thanks, Kevin

回答(1 个)

Mads
Mads 2014-7-9
Anywhere you have a "*" or "/", replace that with ".*" and "./".
I assume you are doing the calculation of F for each pair of X and Phi. Only when you do vector and matrix products use the "*" or "/". Otherwise always ".*" and "./".

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by