I am getting NaN as answer in the code, can please give me some advice

조회 수: 1 (최근 30일)
I have attached the code in a comment , if you guys have any advice thank you
  댓글 수: 1
alberto ortiz
alberto ortiz 2016년 10월 28일
편집: alberto ortiz 2016년 10월 28일
yes I solved by A=zeros(239,239) and B=zeros(239,1) ,,, I am getting all the temperatures for the nodes, yet when I tried to plot it in using the code attached it tells me that index exceeds matrix dimension , any advice ? and thank you very much

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

채택된 답변

Walter Roberson
Walter Roberson 2016년 10월 29일
What is your line
T_new=T(1:182,T_1,183:207,T_1,200:216,T_2,217:233,T_2)
intended to mean?
I suspect you want
T_new=T(1:182, [T_1,183:207,T_1,200:216,T_2,217:233,T_2])
Note: your T_1 and T_2 are empty. You assigned them on the line above with
T_1=t_i*ones(8:1)
T_2=t_i*ones(16:1)
which should probably be
T_1=t_i*ones(1, 8);
T_2=t_i*ones(1, 16);
  댓글 수: 8
alberto ortiz
alberto ortiz 2016년 10월 30일
yes I just saw my mistake thank you very much , I am correcting the code , so edge 182 should be 190. edge 207 should be 215, edge 199 should be 207 , edge 216 should be 232 and edge 233 is 249. Thank you very much for your help
alberto ortiz
alberto ortiz 2016년 10월 30일
Thank you , now T_new has the nodes for the fluid temperature and how should I add the previous matrix T so is all a matrix (33 by 9) with T and the four T_new?

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

추가 답변 (1개)

LauraLee Austin
LauraLee Austin 2016년 10월 28일
inv(A) generates a matrix of inf's, B contains 0's, inf*0 = NaN

카테고리

Help CenterFile Exchange에서 Fluid Network Interfaces Library에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by