answer each question with the code array b) (3 Points) Show an example of how yo
ID: 3846377 • Letter: A
Question
answer each question with the code
Explanation / Answer
The answers are in accordance with MATLAB coding:
a) check = isempty(array)
check will have 1 (true) if the array is an empty and 0 (false) if it isn't.
b) Let's say we have the following structure:
tri = {[20, 30];
[10, 20];
[30, 40]};
use triplot() to just simple plot the triangle and use '-r' to color it red.
c) It is not the difficult to convert the following into while loop, the loop starts with index=100 put the outside and ends when index==0, make that the condition and now just perform the operations and add the decrement to index and you are done.
count=0;
index=100;
while(index>0)
count=count+index;
index=index-2;
end
d) Let's us say we have the following data:
name="Mike";
balance=211.351;
account_number=149701;
Now, string can printed with %s, balance with exactly two precision can be printed with %0.2f add the dollar. Also, add %d for the account number. is used for creating new line.
fprintf("%s has $%0.2f in their account #%d. ",name,balance,account_number);
e) Here is the equation, directly put it.
variable= not(continue = times_up) != false || (not(x<=10) & not(y>100)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.