MATLAB Answers

0

Error: Array indices must be positive integers or logical values.

Asked by Brooke Mitchell on 8 Oct 2019
Latest activity Commented on by Brooke Mitchell on 8 Oct 2019
I have looked at past threads and cannot find the issue of my problem. The error is in the last line with description "Array indices must be positive integers or logical values"
q=10; % W/m^3
km=100; %W/Km
kw=500; %W/Km
R1=1;
R2=1.2;
N=5;
Tr=300;
dr=R1/(N+1);
M=zeros(N+N,N+N);
M(N+1,N+1)=-km/((N+1)*dr^2)-kw((N+1)*dr^2);

  0 Comments

Sign in to comment.

1 Answer

Answer by Stephan
on 8 Oct 2019
Edited by Stephan
on 8 Oct 2019
 Accepted Answer

the expression
kw((N+1)*dr^2)
is the problem. I suspect a missing * or / - for example:
kw*((N+1)*dr^2)

  1 Comment

Thank you so much! After staring at it for hours I completely didn't notice!

Sign in to comment.