How to define no of periods and no of points per period in frequency. If I am changing the Nperiod and Npointperperiod I am getting the same result i.e it is not depending on them. I tried it with for loop also but still not working.

2 views (last 30 days)
P = 0.0035; % Power (W)
f = 6.28; % Frequency (Hz)
Nperiod = 8 ;
NpointPerPeriod = 10 ;
% for f = 6.28
% Nperiod = 8 ;
% Npointperperiod = 10 ;
% end
time = (0:0.1:5);
pi = 3.14;
Pfunction = @(location,state) (P.*ones(size(location.x)) + P*cos(4*pi*f*state.time))/(heater_width*heater_height*1);
h = cos(4*pi*f*time);
plot(time,h);
  2 Comments
Drishti Jain
Drishti Jain on 5 Jun 2020
You are not iterating over the loop. The value of 'f' is fixed to 6.28. As for, Nperiod and Npointperperiod, where should the change in their values be reflected?
Shubhankar Sharma
Shubhankar Sharma on 5 Jun 2020
Thanks for your answer Drishti. I am new in Matlab and my specilisation is in Aerospace Materials and I am more specialized in Cad softwares like Solidworks, Abaqus and all. I know very less about coding in Matlab. Can you please help me in this if you don't mind ? I will be thankful to you.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!