MATLAB Basic Data Type _matlab

Source: Internet
Author: User
Close all;
Clear all;
CLC;
Some operations of%-percent integer data
a=round (3.4);% rounded
to b=fix (-1.9);% to the decimal part
C=floor (3.4);% less than the number and the nearest number
D=ceil (-1.9); A number greater than the number and e=123 from its nearest
;
F=single (e);% conversion to a single precision percent
string of some operations
s1= ' Muahdahd ';
S2= ' SAHFGLAHDFL ';
S3=strcat (s1,s2);% string horizontal connection
s4=strvcat (s1,s2);% string longitudinal connection
s5=upper (S1);% all letters converted to uppercase
S6=S1 (4:7);% Takes the string of a certain interval
[M,n]=size (S1);% returns the string size% percent
logical operator
A=eye (3);% generates diagonal array
b=true (4);% generating logical true matrix%%
function handle, Some privatization functions can be used to
fhandle= @sin;
Y1=fhandle (2*PI);
Y2=functions (fhandle);
%-percent
cell array Stu=cell (2);%2*2 cells array
stu{1,1}={' fjahf ', ' Ahdkah ', ' Hsdahl '};
stu{1,2}={' 12631 ', ' 424 '};
stu{2,1}={' f ', ' m '};
STU{2,2}={20,19};
stu{1,1} (1);% gets the first element of the first cell
stu1=cellfun (' length ', stu);% executes the specified function for each cell
Cellplot (stu);
% percent Structure student=struct (' name ', {' A ', ' B '}, ' age ', {11,22}, ' score ', {rand (3) *10,rand (3) *10});% Create a 1x2 structure, The dimensions of the data require the same
student (2). Name;
Student (2). Score (1,:);% accesses the first row of data in the score field of the second element of the array

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.