Clear Filters
Clear Filters

How to use functions? why it is showing error?

2 views (last 30 days)
surabhi sachdeva
surabhi sachdeva on 4 Feb 2018
Answered: Jan on 4 Feb 2018
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 Comments
Walter Roberson
Walter Roberson on 4 Feb 2018
What function are you trying to use on whatever is in that .mat file?
Jan
Jan on 4 Feb 2018
@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

Sign in to comment.

Answers (1)

Jan
Jan on 4 Feb 2018
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.

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!