Nevermind, I actually figured it out. There is something that bugs me though.I used default plot and I got surface plot anyway... Which is odd and kinda hard to manipulate. But when I was trying to use plot3 or surf or any other type of plot then results were none.
clear
close all
clc
data = load('survey.dat');
X = data(1:9665, 1);
Y = data(1:9665, 2);
Z = data(1:9665, 6);
ft = fittype(strcat('rho*T + rho^2*(a01*T+a02*T^(1/2)+a03+a04/T+a05/T^2) + rho^3*(x06*T+x07+x08/T+x09/T^2)+ rho^4*(x10*T+x11+x12/T) + rho^5*(x13) + rho^6*(x14/T+x15/T^2) + rho^7*(x16/T)+ rho^8*(x17/T+x18/T^2) + rho^9*(x19/T^2)+(rho^3*(x20/T^2+x21/T^3)+rho^5*(x22/T^2+x23/T^4)+rho^7*(x24/T^2+x25/T^3)+rho^9*(x26/T^2+x27/T^4)+rho^11*(x28/T^2+x29/T^3)+rho^13*(x30/T^2+x31/T^3+x32/T^4))*exp(-3*rho^2)'),'independent',{'rho','T'},'dependent','z');
f = fit([X,Y],Z,ft);
view(3);
h = plot(f,[X,Y],Z); grid off, box on;
xlim([0 1.5]);
ylim([0 11]);
zlim([-1700 1100]);
xlabel('\rho', 'FontSize', 12, 'fontweight', 'bold');
ylabel('T', 'FontSize', 12, 'fontweight', 'bold');
zlabel('p', 'FontSize', 12, 'fontweight', 'bold');
title('Graph', 'FontSize', 14);
set(h,'Marker','.','MarkerEdgeColor', 'r', 'MarkerFaceColor', 'r', 'MarkerSize', 4);
colorbar;
I would be more than happy if someone was able to tell me why plot in that code worked as a surf because I have no idea. I tried to use surf initially but no matter how I used it I was getting some errors so I just went with plot because it works... No idea how but it works...
