フィルターのクリア

Error using displayFormula First argument must be string, char, or cell array of character vectors.

3 ビュー (過去 30 日間)
ZoZo
ZoZo 2023 年 12 月 15 日
編集済み: Walter Roberson 2023 年 12 月 15 日
I get an error while using the displayFormula() command
clc;
syms t;
K = 20;
Per = 1.5;
f1 = 100*((2734*t^5) - (6718*t^4) + (5682*t^3) - (1931*t^2) + (228*t));
f2 = -500;
aCo = (1/Per)*( int(f1, t, 0, ((2*Per)/3)) + int(f2, t, ((2*Per)/3), Per) );
w = ((2*pi)/Per);
Fo = zeros(1, K);
%% Fourier
for n=1:1:K
anCo = (1/Per)*(int(f1*cos(w*n*t),t , 0, ((2*Per)/3)) + int(f2*cos(w*n*t), t, ((2*Per)/3), Per) );
bnCo = (1/Per)*(int(f1*sin(w*n*t),t , 0, ((2*Per)/3)) + int(f2*sin(w*n*t), t, ((2*Per)/3), Per) );
Fo = Fo + ((anCo*cos(w*n*t)) + (bnCo*sin(w*n*t)));
end
Fo = Fo + aCo;
displayFormula(Fo)
figure(1)
fplot(Fo,[0 5*Per],'LineWidth',1.5,'Color','#0072BD')
xticks([0 Per 2*Per 3*Per 4*Per 5*Per])
xticklabels({'0', '1T', '2T', '3T', '4T', '5T'})
xlabel('Zaman (t) - [s]')
ylabel('Kuvvet (F) - [N]')
grid on
The error is:
Error using displayFormula First argument must be string, char, or cell array of character vectors.

回答 (1 件)

Dyuman Joshi
Dyuman Joshi 2023 年 12 月 15 日
displayFormula expects text inputs as the error states.
Use disp instead.
  3 件のコメント
ZoZo
ZoZo 2023 年 12 月 15 日
Is there a way to write it out in LaTeX?
Walter Roberson
Walter Roberson 2023 年 12 月 15 日
編集済み: Walter Roberson 2023 年 12 月 15 日
LFo = latex(Fo);
You will want to writelines() it to a file as it is fairly long.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by