How to plot 3d line on fit function?
    8 ビュー (過去 30 日間)
  
       古いコメントを表示
    
    Jan Kowalski
 2017 年 12 月 10 日
  
    
    
    
    
    コメント済み: Jan Kowalski
 2017 年 12 月 11 日
            I want to show how works heuristic algorithm. I have my cost function and i want show every step of algorithm. For example i have cod:
load franke
sf = fit([x, y],z,'poly23')
subplot(1,2,1)
plot(sf)
subplot(1,2,2)
X=x(10:15)
Y=y(10:15)
Z=z(10:15)
plot3(X,Y,Z,'-mo')
grid on
How to show both on one 3D plot?
0 件のコメント
採用された回答
  Kaushik Lakshminarasimhan
      
 2017 年 12 月 10 日
        
      編集済み: Kaushik Lakshminarasimhan
      
 2017 年 12 月 10 日
  
      You need to use hold on. For example,
x  = rand(100,1);
y  = rand(100,1);
z  = x.^2 + y;
sf = fit([x, y],z,'poly23')
plot(sf); hold on;
X=x(10:15)
Y=y(10:15)
Z=z(10:15)
plot3(X,Y,Z,'mo')
grid on;
その他の回答 (0 件)
参考
カテゴリ
				Help Center および File Exchange で Spline Postprocessing についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

