Question: what is the official matlab code for :- am very new to matlab I had the answer for Q1 but the code was used in
what is the official matlab code for :-

am very new to matlab I had the answer for Q1 but the code was used in octave and am using normal matlab script and so the code doesnt work , here is the code from octave if it would help you to translate it to official matlab:-
function m=MakeOdd(mat)
%size of matrix [n,m]=size(mat); for i=1:n for j=1:m %check element if even then ncrease by 1 and make odd if(mod(mat(i,j),2)==0) mat(i,j)=mat(i,j)+1; end end end m=mat; end %input matrix a=[2 7 4;5 8 3] m=MakeOdd(a)
Q1. Write a function that gets a matrix as the input. The output should be the same matrix but all the even clements of the input replaced by the next odd number. So for example if the input is [2 7 4; 5 8 3] the output will be [3 7 5; 5 9 3] Q2. Frequency modulation (FM)-MATLAB Frequency modulation, or FM, uses a wider bandwidth than amplitude modulation, or AM, but it is not affected as much by noise as AM is. The output of an FM transmitter is of the form 0 where m(t) is the message and v is a factor in Hz/volt if the units of the message are in volts. (a) Create as the message a signal m(t) cos(t) Find the FM signal y(t) for v = 10 and then for v = 1 . Let the carrier frequency ,-2t. Use MATLAB to generate the different signals for times 0-t-10 at intervals of Ts = 0.01. Plot m(t) and the two FM signals (one for v 10 and the other for v-1) in the same plot. Is the FM transmitter a linear system? Explain. Create a message signal (b) 1 when m(t) 2 0 -1 when m(t) 0 m1 (t) Find the corresponding FM signal for v 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
