Question: Solution needs to be in MATLAB, the code itself cannot use the pascal function. It has to start with P=ones(4); then use a for loop

 Solution needs to be in MATLAB, the code itself cannot use

Solution needs to be in MATLAB, the code itself cannot use the pascal function. It has to start with P=ones(4); then use a for loop to generate the same output as P==pascal(4).

Write a set of commands in the Live Script to generate a Pascal matrix of size 4 x 4. **Begin with the commands: format P=ones (4); and then use a for loop to re-calculate the entries of P to output a Pascal matrix of size 4 x 4. Hint: For help with this part, you may need to run (do not include it in the Live Script): help pascal and you may also review the topic Pascal Triangle. Display the output matrix P. **Run a logical statement given below to verify that your output for P matches the correct one: P==pascal(4)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To generate a 4x4 Pascal matrix without directly using the pascal function you can follow these step... View full answer

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!