Matlab 3D Plot Help
1 view (last 30 days)
Show older comments
Commented: Yellow Canary on 16 Jan 2015
I am trying to plot my data and create 3D plot. Matlab gives me this error: Warning: Matrix is singular to working precision. My code is below. Can anyone tell me what am I missing? Thank you,
z=(((Pb/(1-Pb))*(p-w))-c)*Hb + w*(Pb*(1-Pa)*Hb + Pa*Pb*Hb)+ wu*Pa*(1-Pb)*Ha;
Youssef Khmou on 16 Jan 2015
Edited: Youssef Khmou on 16 Jan 2015
The program contains an error because y is an empty vector, the version below is altered to have Pb and Pa with same dimensions, to avoid singularity in z, element wise division is used :
[Pb,Pa]=meshgrid(linspace(0,0.1,40)); % 40 points of linear grid.
z=(((Pb./(1-Pb))*(p-w))-c)*Hb + w*(Pb*(1-Pa)*Hb + Pa*Pb*Hb)+ wu*Pa*(1-Pb)*Ha;
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!