Question: This is my code in matlab: fid=fopen('HW5_data.txt'); header=fgetl(fid); g=textscan(fid,'%f %f %f'); fclose(fid); x=g{1}; y=g{2}; z=g{3}; mesh(x,y,z) This is the error message I am getting: >>

 This is my code in matlab: fid=fopen('HW5_data.txt'); header=fgetl(fid); g=textscan(fid,'%f %f %f');

This is my code in matlab:

fid=fopen('HW5_data.txt'); header=fgetl(fid); g=textscan(fid,'%f %f %f'); fclose(fid); x=g{1}; y=g{2}; z=g{3}; mesh(x,y,z)

This is the error message I am getting:

>> HW5 Error using mesh (line 71) Z must be a matrix, not a scalar or vector.

Error in HW5 (line 8) mesh(x,y,z)

I don't understand how to make it a matrix.

The data file is too long to copy and paste into the question. I can email the data text file to whoever is answering this, but I am not able to post the data file to the question as it only allows jpeg files.

fclose(fid); x=g{1}; y=g{2}; z=g{3}; mesh(x,y,z) This is the error message I am

Edit 416 21 49.996282 49.997547 1.666667 1.666667 49.994694 49.991136 49.98 0 49.916712 49.883494 49.845290 49.805996 49.772137 49.752799 49 49.446127 49.377411 49.353602 4 6 59408 49.048944 48.842195 48.670497 48.570878 48.57 49.924551 48.677852 48.292211 47.903321 47.561751 47 48.929410 48.477888 47.931926 47.319885 46.693962 46.128478 45.710439 45.523144 45.625771 160091 46.313956 45.443117 44.646580 44.84805e 43.733666 43.804405 44.27 872 4.166667 4.166667 49.766504 49 21 49.013008 48.532650 47.912 307510 45.432450 44.629532 44.013767 43.694640 43.748 40 46.632400 46.028845 45.554282 45.286187 45. 44.194846 44.980998 45.99 41 49.711744 49.533595 49.276010 48 762 45.540097 46.033078 46.670156 47.3 65 47.378170 47.038611 46.817763 746033 46.826789 47,031123 47.301719 47.566211 6 48.646057 48.549413 48.418740 48.239329 48 63 49.209251 49.180607 48.964648 48 35 49.897976 49.867151 49.832418 49.794269 49.752669 49.706590 49.653743 49.5907 49.513686 49.419545 49.307363 49.1795 49.848374 49.814166 49.772173 49 7 4 4 49.939135 49.928144 49.917443 49 Edit 416 21 49.996282 49.997547 1.666667 1.666667 49.994694 49.991136 49.98 0 49.916712 49.883494 49.845290 49.805996 49.772137 49.752799 49 49.446127 49.377411 49.353602 4 6 59408 49.048944 48.842195 48.670497 48.570878 48.57 49.924551 48.677852 48.292211 47.903321 47.561751 47 48.929410 48.477888 47.931926 47.319885 46.693962 46.128478 45.710439 45.523144 45.625771 160091 46.313956 45.443117 44.646580 44.84805e 43.733666 43.804405 44.27 872 4.166667 4.166667 49.766504 49 21 49.013008 48.532650 47.912 307510 45.432450 44.629532 44.013767 43.694640 43.748 40 46.632400 46.028845 45.554282 45.286187 45. 44.194846 44.980998 45.99 41 49.711744 49.533595 49.276010 48 762 45.540097 46.033078 46.670156 47.3 65 47.378170 47.038611 46.817763 746033 46.826789 47,031123 47.301719 47.566211 6 48.646057 48.549413 48.418740 48.239329 48 63 49.209251 49.180607 48.964648 48 35 49.897976 49.867151 49.832418 49.794269 49.752669 49.706590 49.653743 49.5907 49.513686 49.419545 49.307363 49.1795 49.848374 49.814166 49.772173 49 7 4 4 49.939135 49.928144 49.917443 49

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!