Hi everyone
i'm new in matlab programming,... i'm trying to write matlab code mfile. this mfile will be used by s-function block to caculate the amplitude and the fequency of sine wave signal which comes from another block in the simulink..
if you guys have any idea how to do that could you tell me plzzzz...my project time is running out ...
if you are new to Matlab, then directly jumping to mfile s-functions is not what you should do. If you are good at C or C++ trying making C/C++ S-functions
Thanks for your advice.. but i have to do it using s-function..
i started working on this one but the problem that i'm facing that when i run the program that i created i couldnt determine the zero crossing points which will be used to caculate the frequency..
it seems that the counter of the zero crossing that i put in the program in s-function is working in different way unlike the normal m.file
cause i tryed to generate sin wave using m.file and tryed to catch the crossing points and its ok , but when i tryed to convert this m.file to s-function m.file it didnt work
could u help me to fix this
if u are interested i can send u the s-functiom m.file that i wrote