Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Error using * Inner matrix dimensions must agree. HELP

조회 수: 2 (최근 30일)
Kayn
Kayn 2013년 11월 19일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi,
kRba = linspace(1,10);
kRcb = linspace(1,10);
kRca = (kRba + kRcb);
I need kRca to vary as kRba and kRcb varies, i.e. when it runs through kRba = 4 and kRcb = 4 I need the kRca to equal 8. I'm trying to make a contour map. Is there anyway to do this? This is the full error -
Error using * Inner matrix dimensions must agree.
Error in three_body_system_one (line 15) T1 = mult * cos(kRca);
Any help would be really appreciated

답변 (1개)

Simon
Simon 2013년 11월 19일
Hi!
My guess: You write
T1 = mult * cos(kRca);
If mult and kRca have the same length and you want to multiply element-wise, you write
T1 = mult .* cos(kRca);
If this is not the solution, paste the code to reproduce the error.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by