필터 지우기
필터 지우기

the explicit solution in matlab

조회 수: 2 (최근 30일)
alireza amiri
alireza amiri 2017년 10월 8일
답변: Walter Roberson 2017년 10월 8일
dear i cant solve this equation in matlab please help to me
k=1:1:3
m=2:1:8;
l=0:1:3;
R1=0.5;
g(m)=m/(2*m-1)*(2*m+1);
I1 = @(m, l) k*R1/2*((g(m+1)*I1((m+1),l-1))+I1((m),l-1)+(g(m)*I1((m-1),l-1)))

채택된 답변

Walter Roberson
Walter Roberson 2017년 10월 8일
Anonymous functions cannot refer to themselves.
Your definition gives no way to stop the recursion. You increase the first parameter and decrease the second parameter but there is nothing in your definition that prevents negative second parameters.
The l variable you assign early on is never used.
In your assignment to g, you define g(2:8)but not g(1)
You definition of g(m) uses the row vector m on the left side of the / matrix right divide operator, and a row vector of the same length on the right side of that operator. That is a size error. When you use vectors with the matrix right divide operator, the sizes only work out if you use column vectors. Watch out for the * matrix multiply too. You might instead want ./ and .*

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by