필터 지우기
필터 지우기

Getting error Error using / Matrix dimensions must agree.

조회 수: 1 (최근 30일)
KAPIL MAMTANI
KAPIL MAMTANI 2015년 11월 5일
댓글: KAPIL MAMTANI 2015년 11월 6일
I am running my code effectively but as soon I introduce N2 P2 C2 as 1x1000 size array it gives me error. I intend to run my iterations for random values of these three and see best output .
  댓글 수: 1
Jan
Jan 2015년 11월 5일
Please post the complete error message. It is much easier to suggest a solution if we do not have to search for the line, which causes the error.
If you omit the dull clear all debugging would be much easier.

댓글을 달려면 로그인하십시오.

답변 (1개)

Adam
Adam 2015년 11월 5일
(N/(N2+N))
in your definition of X is causing the problem.
You are trying to divide a scalar by a 1x1000 array.
If you want to divide the scalar by all elements of the array then you need to use
(N./(N2+N))
If that isn't your intention then you need to work out what you do intend for that.
It is probably that some of your other functions run into similar problems.
  댓글 수: 1
KAPIL MAMTANI
KAPIL MAMTANI 2015년 11월 6일
Thank you Adam, Earlier I was assigning scalar values to C2 N2 P2 and the code was running perfectly.But I want to check the code for various random value of these three.Let me tell you ....for example I`ve created a 1x1000 array of these three, now i want to run my loop for full length of t,for Ist set of these three variables and store the results,then run go on running till 1000 sets of these three.Then I will plot them and analyz result.This what i intend to do .Please help me on how to do it...I have posted an image..

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by