How to use functions? why it is showing error?

1 次查看(过去 30 天)
I have a query why is it so I am unable to use a function in this? Please help me rectify my problem. How to use functions? I am trying to use a funcion [mu]
function [mu] = distrmu(distr, dpar)
please suggest
Regards
Surabhi
  2 个评论
Walter Roberson
Walter Roberson 2018-2-4
What function are you trying to use on whatever is in that .mat file?
Jan
Jan 2018-2-4
@surabhi sachdeva: You did not explain any details about the problem, but posted the input data only and mentioned, that there is a problem. Currently it is impossible to help you due to the absence of any details. See: Tutorial: How to ask a good question

请先登录,再进行评论。

回答(1 个)

Jan
Jan 2018-2-4
distrmu is not a Matlab function. But if you ask an internet search engine, you will find a function with this name in the FileExchange: https://www.mathworks.com/matlabcentral/fileexchange/2492-random-numbers-from-simple-distributions
To use this function, download it at first from the given link. Then save it to a folder on your disk. If this folder is not contained in your Matlab path already, use
addpath(FolderName, '-end')
and if you want to store the modified path permanently
savepath
For both commands you find exhaustive help in the documentation. Alternatively use the GUI
pathtool
Nevertheless, maybe you have another problem. You have posted this line already: "function [mu] = distrmu(distr, dpar)". This might mean, that you do have the function already. Then please mention, what you try to do and which problem you have. Currently we know only, that you "try to use this function", but neither how you do it or what you observe instead of which expected result.

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by