Error: 'When calling a function, or indexing a variable, use parentheses. Otherwise check for mismatched delimiters.'
古いコメントを表示
Hi! I am trying to define a new function type (ft) which I was later use to fit a curve. The code I have written is as follows, and I keep receiving the same error message. Can anyone help?
ft = ( 'b + (a * ((x+k)*(x^-1)) )', 'independent', 'x', 'coefficients', {'a', 'b', 'k'} )
I have tried various different types of the equation, with different parentheses including:
parentheses around the whole equation at start as well as parenthese around full function
and 'b + (a*(x/(x+k)))'
4 件のコメント
Dyuman Joshi
2023 年 2 月 17 日
It's not clear as to what you want to do with the particular code.
Do you wish to use a function? or do you wish to resolve the equation in some manner?
Cara
2023 年 2 月 17 日
Dyuman Joshi
2023 年 2 月 17 日
So you want plot a graph corresponding to a, b and k as constants/coefficients and x as the independent variable?
Cara
2023 年 2 月 17 日
回答 (1 件)
Is this what you are trying to do?
ft = fittype( 'b + (a * ((x+k)*(x^-1)) )', 'independent', 'x', 'coefficients', {'a', 'b', 'k'} )
カテゴリ
ヘルプ センター および File Exchange で Get Started with Curve Fitting Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!