Question

Using Matlab. I can't seem to get the fprintf part to display the values in 2 columns. Could someone help me with that

Before calculators were readily available (about 1974), students used tables to determine the values of mathematical function

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

Matlab code :

x = 0:pi/10:2*pi;
j = length(x);
t(:,1) = x;
t(:,2) = sin(x);
disp(' SINE TABLE ')
disp(' x sin(x) ')
fprintf(' %1.2f %1.2f\n',t')

Output :

SINE TABLE Х sin(x) 0.00 0.00 0.31 0.31 0.63 0.59 0.94 0.81 1.26 0.95 1.57 1.00 1.88 0.95 2.20 0.81 2.51 0.59 2.83 0.31 3.14

Add a comment
Know the answer?
Add Answer to:
Using Matlab. I can't seem to get the fprintf part to display the values in 2...
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
  • Q2. (15 pts) Before calculators were readily available, students used tables to determine the values of...

    Q2. (15 pts) Before calculators were readily available, students used tables to determine the values of mathematical functions like sine, cosine, and log. In order to create such a table for sine, write a matlab script using the following steps: • Create a vector of angle values from 0 to 2n in increments of 110. • Calculate the sine of each of the angles, and group your results into a table that includes the angle and the sine value. •...

  • Paragraf 111020030 Stiller 3010012003311416 Q2. (15 pts) Before calculators were readily available, students used tables to...

    Paragraf 111020030 Stiller 3010012003311416 Q2. (15 pts) Before calculators were readily available, students used tables to determine the values of mathematical functions like sine, cosine, and log. In order to create such a table for sine, write a matlab script using the following steps: • Create a vector of angle values from 0 to 2n in increments of 1/10. • Calculate the sine of each of the angles, and group your results into a table that includes the angle and...

  • NEED THE MATLAB CODE Sometimes it is convenient to have a table of sine, cosine, and...

    NEED THE MATLAB CODE Sometimes it is convenient to have a table of sine, cosine, and tangent values instead of using a calculator. Create a table of all three of these trigonometric functions for angles from 0 to 4pi. Prompt the user for the increment in radians. Use disp and fprintf to create a table with a title, column headings, and appropriate spacing. Your table should contain a column for the angle, followed by the three trigonometric function values.  

  • matlab program At time t 0, when a rocket's engine shuts down, the rocket has reached...

    matlab program At time t 0, when a rocket's engine shuts down, the rocket has reached an altitude of 500 m and is rising at a velocity of 125 ms At this point, gravity takes over The beight (m) of the h(t) = -4.9t2125t +500 for t > 0 rocket as a function of time (s) is Construct a table that displays two columns, time (t) and height (h) of the rocket. a. Create a vector t for time from...

  • matlab 2) Plots the individual points with "star" marks b) Fisa cubie spline to the data...

    matlab 2) Plots the individual points with "star" marks b) Fisa cubie spline to the data use "o" marks c) Fits a 5th order polynomial use "x" marks 3) MATLAB contains functions to calculate the natural logarithm (log), the logarithm to the base 10 (log 10), and the logarithm to the buse 2 (log2). However, if you want to find a logarithm to another base for example, base - you'll have to do the math yourself with the formula log)(x)...

  • USING MATLAB 1) Before the internet, engineers used tables to find coefficients for materials such as...

    USING MATLAB 1) Before the internet, engineers used tables to find coefficients for materials such as steel. Structural Engineers must know the bending stiffness (H) for materials such as steel to design and construct an efficient system of support. There can be no bending or torsion in a building or else it will eventually fail and collapse. The equation below relates bending stiffness to moment of inertia (1y) and deformation coefficient (E). Use the information below to calculate (no conversions...

  • Using Matlab, only need part b to be done thank you. 1. Below you will find...

    Using Matlab, only need part b to be done thank you. 1. Below you will find a table with hours of life of a cupper plate used in an industrial process. They are 45 data samples (they are just an array, but in this document, they are presented in three columns to save space) 63 59 75 78 70 64 75 93 90 70 98 92 85 90 83 95 89 92 92 90 82 81 89 80 79 46...

  • use MatLab to answer these questions 1. (10 points) Create an m-file called addup.m Use a...

    use MatLab to answer these questions 1. (10 points) Create an m-file called addup.m Use a for loop with k = 1 to 8 to sum the terms in this sequence: x(k) = 1/3 Before the loop set sumx = 0 Then add each term to sumx inside the loop. (You do not need to store the individual values of the sequence; it is sufficient to add each term to the sum.) After the loop, display sumx with either disp()...

  • -1.2y 7e-03* from x tox 2.0 with the 2) Use Euler's method to solve the ODE...

    -1.2y 7e-03* from x tox 2.0 with the 2) Use Euler's method to solve the ODE initial condition y3 at x0 dx a) Solve by hand using h b) Write a MATLAB program in a script file that solves the equation using h-0.1 and find y(1.5). c) Use the program from part (b) to solve the equation using h= 0.01 and h = 0.001 and findy(1,5). 0.5 and find y(2). d) The exact solution to the IVP is given by...

  • I need help with my javascript project, I've started on it but I can't seem to...

    I need help with my javascript project, I've started on it but I can't seem to get ym java scripts to work with my index.html. Can someone please help me fix my code? I need the main.js & scratchpad.js to work with my index.html .Thank you Directions: Go to the following link: https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics On that page, scroll down to "A 'hello world' example". Follow the step-by-step instructions to download their code and edit it in your text editor of choice....

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