Question: ( a ) Sketch a flowchart ( Visio diagram ) for Matlab code that repeatedly prompts a user to enter ( 5 marks ) a

(a) Sketch a flowchart (Visio diagram) for Matlab code that repeatedly prompts a user to enter
(5 marks)
a prime number until the user enters a prime number. Use a while loop and an if statement.
(b) Write a Matlab code snippet for the problem outlined in (a) above. Your code should output appropriate messages when the number entered is, and is not, a prime number. Hint: Use a while loop and Matlab's input (), disp ()/ fprinte () and
(5 marks)
isprime () functions.
(c) Consider the arrays below containing the names of elements and their corresponding atomic weights:
element=["Hydrogen" "Helium" "Lithium"];
a_weight =[1.007,4.003,6.941];
Using Matlab's fprintf() function, write code that uses a for loop to print out the following:
The atomic weight of Hydrogen is 1.007amu
The atomic weight of Helium is 4.003amu
The atomic weight of Iithium is 6.941amu
(5 marks)
Use matlab.
 (a) Sketch a flowchart (Visio diagram) for Matlab code that repeatedly

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!