Entering a value into a returned string

I was wondering if there was a way to insert a value into multiple returned strings of a Taylor series. I tried it with two for commands but this isn't working how I thought it would. My code is
syms x
f=25*x^3-6*x^2+7*x-88
for x=1
for n=(0:4)
y=taylor(f,n)
end
end
Thanks in advance for any help.

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 1월 30일

0 개 추천

May be so?
a = 1;
y = cell(5,1);
n = 0:4
for j1 = 1:numel(n)
y{j1} = taylor(f,n(j1),a);
end
OR
y1 = arrayfun(@(j1)taylor(f,j1,a),n,'un',0)
ADD
y1 = arrayfun(@(j1)subs(taylor(f,j1),x,1),0:4)

댓글 수: 3

Adam Anderson
Adam Anderson 2012년 1월 30일
Not sure what is going on in your code there. Since I have to do it for such a small number of terms I will just do it one by one.
Andrei Bobrov
Andrei Bobrov 2012년 1월 30일
see ADD
Adam Anderson
Adam Anderson 2012년 1월 30일
It runs but doesn't give what I was looking for. Perhaps I should redefine the question and repost. Thanks f thoughor the input

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

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by