how to generate a polynomial
이전 댓글 표시
i have two matrix one is
s=[2 3
4 5]
other is
text = [3 5 6 7
3 4 5 6]
based on my threshold value i should form a polynomial
say for exam threshold is 2 my polynomial should be
P= s(1,1)*x^0 + text(1,1)*x^1
if threshold is 3 my polynomial should be
P= s(1,1)*x^0 + text(1,1)*x^1 + text(1,2)*x^2 i have to process for every
digit like this .... value from should be taken once but from text van be any
number of times based on threshold...
Thanks in advance ..i am not able to trace it out please help
댓글 수: 15
Azzi Abdelmalek
2012년 11월 24일
is it always s(1,1)?
Matt Fig
2012년 11월 24일
Yes, what is the general pattern? Are the other elements of S never used?
Sharen H
2012년 11월 24일
Walter Roberson
2012년 11월 24일
Your "text" is a matrix. When is the second row of the matrix used?
Yet still you don't reveal the general pattern....
P(m,n) = _________________________
(for m = 1:size(s,1) and n = 1:size(s,2) ????)
Fill in the blank and clarify the ranges.
Sharen H
2012년 11월 24일
Sharen H
2012년 11월 24일
Azzi Abdelmalek
2012년 11월 24일
It's still not clear for me, what does that mean
s(1,2)+t(1,3)*x^1+t(2,1)*x^2
Azzi Abdelmalek
2012년 11월 24일
for s it's clear, how are using t?
Sharen H
2012년 11월 24일
Walter Roberson
2012년 11월 24일
So if your threshold is N, you take N-1 consecutive entries from t, proceeding along columns, and "wrapping" along to the next row ?
Azzi Abdelmalek
2012년 11월 24일
편집: Azzi Abdelmalek
2012년 11월 24일
Then why t(2,1) is repeated?
Walter Roberson
2012년 11월 24일
In Sharen's comment http://www.mathworks.co.uk/matlabcentral/answers/54693-how-to-generate-a-polynomial#comment_113211, t(2,1) appears only once.
채택된 답변
추가 답변 (2개)
Azzi Abdelmalek
2012년 11월 24일
편집: Azzi Abdelmalek
2012년 11월 24일
s=[2 3 ;4 5]
text = [3 5 6 7 3 4 5 6]
threshold=4;
x=11
c=1:threshold-1
P=s(1,1)+sum(text(c).*x.^c)
댓글 수: 2
Sharen H
2012년 11월 24일
Azzi Abdelmalek
2012년 11월 24일
If threshold=3 what should be the result?
Matt Fig
2012년 11월 24일
Sharen, please fill in the blank and define the ranges:
P(m,n) = _________________________
(for m = 1:size(s,1) and n = 1:size(s,2)) <---- correct??
카테고리
도움말 센터 및 File Exchange에서 Polynomials에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!