How do I place random numbers generated into a function and then plot data points?

6 visualizaciones (últimos 30 días)
I am currently in the process of creating a code that will create random numbers based on 4 sets of Mean and Standard deviations given to me. After I generate 10 random numbers I want to place the new variables I created using normrnd into a function that using the four parameters such as y=x(b*a)+z .... Finally I want to create a linear model plotting 10 sets with about 20 data points in each set. I am new to matlab so if I have incorrectly stated my objectives I am sorry. I am looking for help or to be atleast directed where I can learn to do what I am trying to accomplish. The paper also ask me to complete certain tasks, so i included it as well just in case further info is needed. The picture of the graph is exactly what I am trying to do. My code so far is :
function []=SIM()
mu_sa = -9.860e-07; sgm_sa = 9.860e-08;
mu_ta = 5.752e-02; sgm_ta =5.752e-03;
mu_sb = 8.983e-01; sgm_sb = 8.983e-02;
mu_tb = -8.340e-04; sgm_tb = 8.340e-05;
index_c =[1:50:300]
sa = normrnd(mu_sa, sgm_sa,[1,10])
ta = normrnd(mu_ta, sgm_ta,[1,10])
sb = normrnd(mu_ta, sgm_ta,[1,10])
tb = normrnd(mu_ta, sgm_ta,[1,10])
%

Respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by