Question

Use MATLAB to determine how many elements are in the array sin(-pi/2):0.05:cos(0). Use MATLAB to determine...

  1. Use MATLAB to determine how many elements are in the array sin(-pi/2):0.05:cos(0).
  2. Use MATLAB to determine the 10th element.

Homework Answers

Answer #1

Problem is solved using Octave open source compiler similar to MATLAB

#####MATLAB CODE

clc;
clear all;
%write given array
A=sin(-pi/2):0.05:cos(0);
[M N]=size(A);
fprintf('Number of elements in given array=%d', N)
B=A(1,10);
fprintf('\n\n10th element of array is %d', B)

########OUTPUT###

Number of elements in given array=41

10th element of array is -0.55

Know the answer?
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
Similar Questions
Use Matlab plots to determine how many real-valued solutions sin 2x = x has.
Use Matlab plots to determine how many real-valued solutions sin 2x = x has.
Write a program to determine the minimum element in an array of ten elements. The program...
Write a program to determine the minimum element in an array of ten elements. The program should have the following: 1. Class Name as ArrayProcessing. The main method should create an array of size 10 2. There should be two methods besides the main method in the class namely inputArray and MinimumElement 3. InputArray method should assign the ten elements in the array. Use scanner to input these elements. The array of 10 numbers in the method "InputArray" should be...
if f''(x)= -cos(x)+sin(x), and f(0)=1 and f(pi)=), what is the original function
if f''(x)= -cos(x)+sin(x), and f(0)=1 and f(pi)=), what is the original function
Determine the solutions to the equation 2sinx - cos^2 x = sin^2 x for 0≤x≤2pi.
Determine the solutions to the equation 2sinx - cos^2 x = sin^2 x for 0≤x≤2pi.
Find the length of the curve 1) x=2sin t+2t, y=2cos t, 0≤t≤pi 2) x=6 cos t,...
Find the length of the curve 1) x=2sin t+2t, y=2cos t, 0≤t≤pi 2) x=6 cos t, y=6 sin t, 0≤t≤pi 3) x=7sin t- 7t cos t, y=7cos t+ 7 t sin t, 0≤t≤pi/4
Using Matlab to obtain the output squence that results when you use k(n) = cos(pi*n/4) as...
Using Matlab to obtain the output squence that results when you use k(n) = cos(pi*n/4) as the input. y(n) = x(n) + 2x(n-1) + x(n-2) + 0.8y(n-1) - 0.64y(n-2) Plot (stem) the resulting output. n=255 Amplitude? Was the signal amplified through the system? By how much?
Using matlab. Consider the function s(t) defined for t in [0,4) by { -sin(pi*t/2)+1 , for...
Using matlab. Consider the function s(t) defined for t in [0,4) by { -sin(pi*t/2)+1 , for t in [0,1) s(t) = { -(t-2)^5 , for t in [1,3) { sin(pi*t/2)-1 , for t in [3,4) (i) Generate a column vector s consisting of 512 uniform samples of this function over the interval [0,4). (This is best done by concatenating three vectors.)
6.) Let ~r(t) =< 3 cos t, -2 sin t > for 0 < t <...
6.) Let ~r(t) =< 3 cos t, -2 sin t > for 0 < t < pi. a) Sketch the curve. Make sure to pay attention to the parameter domain, and indicate the orientation of the curve on your graph. b) Compute vector tangent to the curve for t = pi/4, and sketch this vector on the graph.
Find the average of the function ?(?) = sin(?) + cos(2?) over the interval 0 ≤...
Find the average of the function ?(?) = sin(?) + cos(2?) over the interval 0 ≤ ? ≤ 2?.
Derive the Fraunhofer pattern for an array of N slits: I(?) = I(0) (sin?/?) ^2 (sinN?/...
Derive the Fraunhofer pattern for an array of N slits: I(?) = I(0) (sin?/?) ^2 (sinN?/ N sin?)^2