How can i generate random variable for j elemnts in my matrix from set of data i've?
i'm trying to write a code for to generate random cases for doing simple data research , i'll be grateful if someone helps me with it , this is my code:
patient_condition=[0.05; 0.15; 0.25; 0.35; 0.45; 0.55; 0.65; 0.75; 0.85; 0.95];test_type=[0.1 0.26 0.42 0.58 0.74 0.9];patient_origin=[0.12 0.23 0.34 0.45 0.56 0.67 0.78 0.89];doctor_orogin=[0.02 0.212 0.404 0.596 0.788 0.98];patient_age=[0.15 0.4 0.65 0.9];insurance=[0.04 0.26 0.48 0.7 0.92];hospital=[0.06 0.24 0.42 0.6 0.77 0.96];for j=1:1000 p(1,j)=patient_condition(randi(patient_condition)); p(2,j)=test_type(randi(test_type)); p(3,j)=patient_origin(randi(patient_origin)); p(4,j)=doctor_orogin(randi(doctor_orogin)); p(5,j)=patient_age(randi(patient_age)); p(6,j)=insurance(randi(insurance)); p(7,j)=hospital(randi(hospital));end
Best Answer