Question

MATLAB : Practice-4 (Oct. 31/ Nov. 1) Seat No. Name: Solve the following problems and write in the answers in blue and the pl

0 0
Add a comment Improve this question Transcribed image text
Answer #1

2)



n = 10;
for i = 1:n
fprintf("%6i %8.4f\n", i, sqrt(i));
end

--------------------------------------------------------------------

3)


a = [3,40,1,8,0];
b = [-7,5,4,16,1];
c = [];
n = 1;
while ( n<=5 )
c(n) = a(n) + b(n);
n = n + 1;
end
disp(c)

----------------------------------------------------------------------------------------------------------------------

1 10; for i = 1:n fprintfC%6i %8.4f\n, i, sqrt(i)); end n = 3 4 5 %- [3,40,1,8,0]; -7,5,4,16,1]; 6 7 8 С%3 1; while n = 10

PLEASE COMMENT if there is any concern.

==========================================

Add a comment
Know the answer?
Add Answer to:
MATLAB : Practice-4 (Oct. 31/ Nov. 1) Seat No. Name: Solve the following problems and write...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please help me with this MATLAB CODE and explain to me what each line does and...

    please help me with this MATLAB CODE and explain to me what each line does and what is used for? leave your comments as words, not as pictures. ..................................................................................................................................................................... clear all; close all; % For a script file, you better start with clear all and close all                        % However, for a fucntion, you better NOT to start                        % with them %% End of cell mode example %% Plot function t = 0:0.1:5; x1 = sin(2*5*t); x2 = cos(3*7*t);...

  • i need help in this assignment by using matlab. codes only or capture the solutionPlot t...

    i need help in this assignment by using matlab. codes only or capture the solutionPlot t versus v with line width 1.5, dotted, red colored line, triangle shaped, marker with size 10, black edge, and green face. A1-2. a. Determine the drae coefficient (cd) using the equation: cd = g*m/upsilon^2from the exploratory data analysis below: g=9.81 b. Find out average, maximum, and minimum of cd by the command meant(cd), max(cd), and min(cd) respectively. c. Determine the predicted terminal velocity by...

  • Matlab help *****CONSTANT***** NUM_MONTHS = 12; FIRST_YEAR = 2013; LAST_YEAR = 2016; %*****...

    matlab help *****CONSTANT***** NUM_MONTHS = 12; FIRST_YEAR = 2013; LAST_YEAR = 2016; %*****INPUT***** months = 1:NUM_MONTHS; years = FIRST_YEAR:LAST_YEAR; % read data file lake_powell = load( 'lake_powell.txt' ); % OR load lake_powell.txt % print with title and year column headings. fprintf(' Lake Powell Water Levels (in feet)\n') fprintf('%8d ', years) fprintf('\n') % print contents of lake_powell for month = 1:NUM_MONTHS fprintf('%9.2f', lake_powell(month,:)) fprintf('\n') end % PART B ========================================================== fprintf('\nPART B: Determine average elevation of water level for each year and...

  • Please solve problem 4 and 5 using matlab and include the screenshot of the result ,...

    Please solve problem 4 and 5 using matlab and include the screenshot of the result , thank you Homework #8 Applied Programming, ENGR 10573 Spring 2018 Due Monday, Apr. 2 uploaded through TCU Online by 11:59 PM. Upload one script or function, named studentlastn ame-homework 8 ) n a single m- file that runs each problem. The homework problems should run sequentially showing I figure and or plots along with the proof that each problem works correctly. The single m-file...

  • (a) (4 points) Fill in the blanks in the following MATLAB function M file trap so...

    (a) (4 points) Fill in the blanks in the following MATLAB function M file trap so that it implements the composilu trapezidul rulo, using a soquence of w -1,2, 4, 8, 16,... trapezoids, to approximatel d . This M file uses the MATLAB built-in function trapz. If 401) and y=() f(!)..... fr. 1)). 3= ($1, then the execution of z = trapz(x, y) approximates using the composite trapezoidal rule (with trapezoids). (Note that the entries of are labeled starting at...

  • Please follow following scripts: Script for part A:Script for Part B: Matlab Exercises 1. Find the...

    Please follow following scripts: Script for part A:Script for Part B: Matlab Exercises 1. Find the determinant (command: det(A)) and the condition number (command: cond(A)) of the Hilbert matrix H of order k (command: hilb(k)), for k = 1,2, ..., 10. Plot the determinant and the condition number as a function of k using a logarithmic scale for the vertical axis. Hint: The template to help you with this homework assignment is homework/hw15.m. 2. Determine if y is in the...

  • MATLAB Assignment #1: Solve the following problems by writing commands in by writing a program in...

    MATLAB Assignment #1: Solve the following problems by writing commands in by writing a program in a script file and executing the file. Tum in a printout of the results and email the m file. All work should be individual, not shared 9. Let a 13, b= 4.2 (4b) abc d= ab+c then evaluate da - (a- )(c+ d) cb c+ d 10. A cube has a side of 18 cm. Detemine the radius of a sphere that has the...

  • Assignment 6 Name: Write or type work and solutions on a separate paper. If written, write...

    Assignment 6 Name: Write or type work and solutions on a separate paper. If written, write legibly. 1. A rock is thrown upward from a level ground in such a way that the maosimum height of its flight is equal to its horizontal range. At what angle is the rock thrown? 2. A projectile is fired with a velocity of 60V2 m/s northeast. How long does it take for the ball to reach its highest point? a. b. What horizontal...

  • can you write a matlab code PROJECT DELIVERABLE 1: In Project Deliverable 1, you will write...

    can you write a matlab code PROJECT DELIVERABLE 1: In Project Deliverable 1, you will write a Matlab code to automatically run your Simulink model where two parameters change, and save the performance index. Finally, youu plot the corresponding performance index as a 3D plot. Step 1) Build the following system in Simulink and name it as "FirstOrderSystem_ProjectGroupnumber.mdl". Finrderte Diegram S dion oulo Ro Cede Helps Md re Prrd K sebr Stro Transter Ecn gdet 100% Ready In this system,...

  • answer 4, 5, 6, 7 using matlab Homework 10 1. Write the correct first-line syntax for...

    answer 4, 5, 6, 7 using matlab Homework 10 1. Write the correct first-line syntax for a user defined function that is named Feynman and has input variables q and e, and outputs L and M. (Comment out of this line). 2. Using zeros, ones, and eye commands write the one line syntax to create the following matrix: 00000 01100 01010 01001 3. Write the syntax for the user defined function that calculates the surface area and volume of a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT