The error people were getting was because of them downloading the wrong lagrange.m function. To make things simplier, I've updated the code to use INTERPT1. Lagrange.m is no longer needed. Thanks goes to Shan Zou for letting me know why he was getting the same error as previous people here.
I've updated the zip file to include an example mat file (ex1) and forgo the need for people to extract out a sample dataset from the example.mat file. I hope this helps, and expedite any need to fix a problem should it arise.
Greg,
I'm not sure about the need of a resolution. I cannot recreate any errors. If you want, send me your ex1.mat file. It should be the same, but obviously something is different.
When I run the ex1 file, created as you specify from the examples.mat file, I get the same message as the previous post:
>>b17(ex1, .590537, 'c:\temp\test.png', 'Demo Station',1)
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.
Error in ==> b17>freqCurve at 444
K(i) = lagrange([g k], G, 4);
Error in ==> b17 at 292
[K floodfreq Gzero] = freqCurve(Xmean, S, G, ktable);
Any resolution to this issue?
Thanks
Greg
K R,
Hmm...not sure why you're getting unequal numbers. Assuming you open the example.mat file so it shows in your Workspace, then run these next for lines exactly:
ex1 = examples(~isnan(examples(:,2)),1:2);
ex2 = [examples(~isnan(examples(:,3)),1) examples(~isnan(examples(:,3)),3)];
ex3 = [examples(~isnan(examples(:,4)),1) examples(~isnan(examples(:,4)),4)];
ex4 = [examples(~isnan(examples(:,5)),1) examples(~isnan(examples(:,5)),5)];
Then run the function again pointing to either: ex1, ex2, ex3, or ex4. I hope this helps. Email me directly if you need more help. Regards,
jeff.
Comment only