Combination and surface plot

1 次查看(过去 30 天)
Damilola
Damilola 2015-4-14
回答: pfb 2015-4-14
Please I need help on code for getting combination of the attached energy use schedule, each schedule has an equivalent energy cost and consumption and the practicality of each schedule ranges from 1 to 10, i.e. each schedule could have a practicality of 1, 2, 3, ...,10. I want to use the results to then obtain a surface plot that has Cost, consumption and practicality on each the axes. I will be glad if someone can help me out or lead me on how to go about writing a code for this. Thanks
  3 个评论
John D'Errico
John D'Errico 2015-4-14
编辑:John D'Errico 2015-4-14
The data that you give in that worksheet has 6 sets of numbers, for 6 possible schedules. No practicality is even shown.
So the answer is, given the information you have provided, no such plot can be generated. Magic only works for Harry Potter.
Even if you did improve the data, so that you had actually told us the practicality for each such schedule, you would still almost certainly not be able to generate a complete surface. At least, any such surface would be a terribly poor guess. Your data is simply inadequate to generate a surface. You have 6 data points that are not at all well scattered. What did I say about magic? It still won't work.
Damilola
Damilola 2015-4-14
Thanks for your comments, an example of what I need to plot is cost = [0.056;0.0399;0.0398;0.0334;0.052;0.0502] consumption = [0.6111;0.6111;0.6181;0.5451;0.5475;0.611] practicality = [1;6;7;9;5;4]
Thanks once again

请先登录,再进行评论。

回答(1 个)

pfb
pfb 2015-4-14
You could try "trisurf". But I agree with John d'Errico that your have too few data.
tri=delaunay(cost,consumption);
trisurf(tri,cost,consumption,practicality);
You actually get a surface...

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by