¿Porque no corre mi código? No aparece nada
139 ビュー (過去 30 日間)
古いコメントを表示
Ana Paula Juárez Mendoza
2021 年 4 月 15 日
コメント済み: Constantino Carlos Reyes-Aldasoro
2021 年 4 月 16 日
Le pongo en correr y no pasa nada
1 件のコメント
the cyclist
2021 年 4 月 15 日
Google-translated into English:
"Why is my code not running? Nothing appears."
回答 (1 件)
Constantino Carlos Reyes-Aldasoro
2021 年 4 月 15 日
Hola,
Primero unas recomendaciones:
1) te recomiendo escribir en ingles porque en espan~ol es mas dificil tener ayuda
2) te recomiendo usar codigo y no imagenes para que sea posible copiar tu problema directamente.
Ahora sobre tu problema, si copias el codigo directamente en el command window funciona:
>> A=[1 1.28; 1 0.66];
>> B=[0.88;1.14];
>> X=inv(A)*B
X =
1.4168
-0.4194
La parte siguiente tiene un error, que si tratas de correr te dira el error:
>> fprintf('La ecuacion es y=%fx+f',(X(2),X(1)))
fprintf('La ecuacion es y=%fx+f',(X(2),X(1)))
↑
Error: Invalid expression. When
calling a function or indexing
a variable, use parentheses.
Otherwise, check for mismatched
delimiters.
Yo creo que estas tratando de seguir sintaxis de C en lugar de usar y escribir en sintaxis de Matlab:
>> disp(strcat('La ecuacion es y=',num2str(X(2)),'+',num2str(X(1))))
La ecuacion es y=-0.41935+1.4168
>>
Esto debe resolver tu problema. Si tienes mas dudas, dime, si no, por favor accepta la respuesta.
4 件のコメント
Constantino Carlos Reyes-Aldasoro
2021 年 4 月 16 日
De nada! Si esto resuelve tu problema, por favor acepta la respuesta
参考
カテゴリ
Help Center および File Exchange で Image Segmentation and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!