Filter löschen
Filter löschen

Dimensions do not agree??

2 Ansichten (letzte 30 Tage)
Kevin
Kevin am 9 Jul. 2014
Beantwortet: Mads am 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

Antworten (1)

Mads
Mads am 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 "./".

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by