Ask an expert. Trust the answer.

Your academic and career questions answered by verified experts

Writing cos functions with two variables in MATLAB

Date: 2022-12-19 11:51:09

How do I write the following function in MATLAB: 

 

f(x)=cos h (x^2)

I have been trying this: 

 

function y=f01(x,h) y=cos(h).(x.^2); function y=f01(x,h) y=cos(h)*(x.^2);7 function y=f01(x,h) y=cos(h)(x.^2);

And many more instances. Nothing works. I can't find similar examples in the cos function documentation. 

Answer: 

I found out that the equation can be written as follows: 

 

function y=f01(x,h) y=cos(h*(x.^2));

 


Why Matlabhelpers ?

Our Matlab assignment helpers for online MATLAB assignment help service take utmost care of your assignments by keeping the codes simple yet of high-quality. We offer the most reliable MATLAB solutions to students pursuing their Computer Science course from the Monash University, the University of Sydney, the University of New South Wales, the University of Melbourne; to name a few. Approach us today for best Matlab solutions online!

whatsApp order on matlabhelpers.com

telegram order on matlabsolutions.com