Home > Common Problem > What is the matlab output statement?

What is the matlab output statement?

藏色散人
Release: 2020-11-30 16:56:55
Original
52742 people have browsed it

There are two types of matlab output statements, namely: 1. Free format, with syntax such as "disp(23 454-29*4)"; 2. Formatted output, with syntax such as "fprintf('The area is %8.5f\n',area)".

What is the matlab output statement?

MATLAB input and output statements

1.MATLAB input statement input function is used to receive user input :

a.Input data

>> x=input('please input a number:')
please input a number:22
x =
   22
Copy after login

b.Input string

>> x=input('please input a string:','s')
please input a string:this is a string
x =
this is a string
Copy after login

2.MATLAB output statements include free format (disp) and formatted output (fprintf)

>> disp(23+454-29*4)
   361
>> disp([11 22 33;44 55 66;77 88 99])
   11   22    33
   44   55    66
   77   88   99
>> disp('this is a string')
this is a string
>> area=12.56637889;
>> fprintf('The area is %8.5f\n',area)
The area is 12.56638
>>
Copy after login

The above is the detailed content of What is the matlab output statement?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template