Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Evaluating a string:
The function eval is used to compute a string as a function. For illustration, below is the string 'plot(x)'is interpreted to be a call to plot the function, and it generates the plot as shown in figure.
>> x = [2 6 8 3];
>> eval('plot(x)')
This would be helpful if the user entered the name of the type of plot to use. In illustration, the string that user enters (in this situation 'bar') is concatenated with the string '(x)' to generate the string 'bar(x)'; this is then computed as a call to the bar function as shown in figure.
Also, the name of the plot type is used in the title.
Example to change the line width from the default: For illustration, to change the line width from the default of 0.5 to 1.5: >> set(hl,'LineWidth',1.5) As long as the
Plotting from a Function: The following function creates a Figure Window as shown in figure, which shows various types of plots for similar y vector. The vector is passed as a
Example of Plotting from a Function: For illustration, the function can be called as shown below: >> y = [1:2:9].^3 y = 1 27 125 343 729
num2str function: The num2str function, that converts real numbers, can be called in many ways. If only the real number is passed to the num2str function, it will generate a s
about sampling theorem
Example of modular program: In a modular program, there would be one main script which calls three separate functions to complete these tasks: A function to prompt an us
Expanding a function: The expand function will multiply out terms, and factor will do the opposite: >> expand((x+2)*(x-1)) ans = x^2 x-2 >> factor(ans)
deblank function: The deblank function eliminates only trailing blanks from the string, not leading the blanks. The strtrim function will eliminate both the leading and traili
Comparing strings: There are few functions which compare strings and return logical true when they are equivalent or logical false when not. The function strcmp compares the s
ischar function: The ischar function return the logical true if an array is a character array, or logical false if not. >> vec = 'EK127'; >> ischar(vec) ans =
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd