disp(‘hello world’);

99 次查看(过去 30 天)
Hassan
Hassan 2023-1-27
回答: Shakib 2025-9-22
disp (hello world);
  2 个评论
N/A
N/A 2025-8-1
a=((hello world))
Unexpected 'world' in parentheses. When creating a matrix, use square brackets [].
Walter Roberson
Walter Roberson 2025-8-2
That is incorrect. The function hello does not accept any input parameters, and does not return any outputs.

请先登录,再进行评论。

采纳的回答

Chris
Chris 2023-1-27
编辑:Chris 2023-1-27
disp ('hello world');
hello world
Your apostrophes are wrong. How did you generate them? Here is your version:
disp (hello world);
Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.

Error in connector.internal.fevalMatlab

Error in connector.internal.fevalJSON
You could also use double quotes: " "
  1 个评论
DGM
DGM 2025-8-4
编辑:DGM 2025-8-20
This is a common problem that happens when people copy-paste code that's presented on websites that use prettytext formatting. I don't know if there are other issues with localization that could cause the same thing, but there are countless websites full of curly-quoted code. It's up to you to watch out for bad quotes, hyphens, and spaces.
It doesn't show up in the forum editor, but these invalid characters should be highlighted by your editor.

请先登录,再进行评论。

更多回答(1 个)

Shakib
Shakib 2025-9-22
disp command,
disp("Hello World")
Hello World

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by