PLEASE HELP ME -- unexpected expression

clc;
clear;
A=input('A katsayısı');
B=input('B katsayısı');
C=input('C katsayısı');
delta=B^2-4*A*C ;
if A==0
disp('Denklem 2. derece değil');
elseif delta>0
y1=(-B+sqrt(delta))/(2*A);
y2=(-B-sqrt(delta))/(2*A);
fprintf('1. kök: %g /n 2. kök: %g /n 'y1,y2);
elseif delta==0
kok=-B/(2*A);
fprintf('Tek kök vardır. Kök %g',kok);
elseif delta<0
disp('Denklemin reel kökü yok.');
else
end
Error: File: Untitled2.m Line: 14 Column: 42
Unexpected MATLAB expression.

 採用された回答

Stephen23
Stephen23 2020 年 5 月 15 日
編集済み: Stephen23 2020 年 5 月 15 日

0 投票

fprintf('1. kök: %g \n 2. kök: %g \n ',y1,y2);
% ^ your code is missing this comma
% ^^ ^^ your code used incorrect forward slash

2 件のコメント

Walter Roberson
Walter Roberson 2020 年 5 月 15 日
fprintf('1. kök: %g \n 2. kök: %g \n',y1,y2);
Emre Tutucu
Emre Tutucu 2020 年 5 月 15 日
Thank you its works :)

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEntering Commands についてさらに検索

タグ

質問済み:

2020 年 5 月 15 日

編集済み:

2020 年 5 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by