필터 지우기
필터 지우기

Dimensions do not agree??

조회 수: 2 (최근 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