How to remove matrix dimension exceeds issue.

How to remove matrix dimension exceeds issue.

답변 (1개)

Luis FigueroaFernandez
Luis FigueroaFernandez 2021년 5월 25일

0 개 추천

Hi Zain,
Couple of things, first, I dont see 'y' defined within your lobal variables (which local variabler are not really recommended in good programming practices), and second, for you to use 'y' within a function you would have to share the variable while calling and receiving the function.
eg:
%Calling your function
[x,y] = solbasic(y)
%...
function [x,y] = solbasic(y)
global tspan x0 C T_wi
[~, x] = ode15s(@basic, tspan, x0);
y = x*C' + T_wi;
disp(y)
end

댓글 수: 2

Zain
Zain 2021년 5월 25일
Still not working.
Yust checked again and you haven't declared 'y' at all. You have to create 'y' in your main code, you cannot share a variable that doesn't exist.
y = 0;
Before shaing it to the funcion

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

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

제품

질문:

2021년 5월 25일

편집:

2021년 5월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by