2391 Shares

# Easy Q: Matlab how to program an M-file that accesses another M-file for its data 10pts?

Topic: How to write a program in matlab
June 27, 2019 / By Orson
Question: I am fitting a 2nd order regression curve to some data ussing a least squares method and finding the required co-efficents, m-file polyregr2.m which works fine... Now I'm trying to visualise this fit ussing with a second m-file (plotreg.m) wich I want to pull all the data from polyregr2.m to complete the m-file file I wrote is shown; polyregr2(T,v); t = min(T):0.05:max(T); m = size(t,2); for i = 1:m f(i) = a(n+1); for j = n:-1:1; f(i) = a(j) + f(i)*t(i); end end plot(t,f,'r--') hold on plot(v, T, 's') Now when I put all this in an error saying I haven't defined any of the co-efficents comes up when it should have got it from poleregr2.m how can I make this happen? In polyreg2r.m I have defined T,v and n

## Best Answers: Easy Q: Matlab how to program an M-file that accesses another M-file for its data 10pts?

Len | 8 days ago
u call polyregr2(T,v); whitout giving values to T and v edit doesnt poluregr2 needs a input for work? if no give it some outputs and do [T v n]=poliregr2; poliregr2 need to have a output in the *.m file note every time u get out of a function it reset all the variables (unless they are global or they are returned)
👍 264 | 👎 8
Did you like the answer? Easy Q: Matlab how to program an M-file that accesses another M-file for its data 10pts? Share with your friends

We found more questions related to the topic: How to write a program in matlab

Originally Answered: How take the form data from a.html file process in a.php file and output in.html file?
Originally Answered: How take the form data from a.html file process in a.php file and output in.html file?
The PHP doesn't need to write to another document, just have the PHP file send HTML code to the user. For example, if you are POSTing the variables firstname and lastname, just put this in roster.php: