Dimensions do not agree??

2 views (last 30 days)
Kevin
Kevin on 9 Jul 2014
Answered: Mads on 9 Jul 2014
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

Answers (1)

Mads
Mads on 9 Jul 2014
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 "./".

Community Treasure Hunt

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

Start Hunting!