Filter löschen
Filter löschen

How to use functions? why it is showing error?

2 Ansichten (letzte 30 Tage)
surabhi sachdeva
surabhi sachdeva am 4 Feb. 2018
Beantwortet: Jan am 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 Kommentare
Walter Roberson
Walter Roberson am 4 Feb. 2018
What function are you trying to use on whatever is in that .mat file?
Jan
Jan am 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

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jan
Jan am 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.

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by