Wednesday 15 August 2012

matlab - Undefined function or method 'mtimes' for input arguments of type 'struct' -


I have an array of 550x128 size I save it in a .mat file and use it in another function Loading again for

  save ('c: \ coeffs2.mat', 'descr2'); Des2 = load ('c: \\ coeffs2.mat');   

I use this value as follows:

  des2t = des2 '; I for = 1: size (des1,1) dotprods = des1 (i, :) * des2t;   

Where des1 is another array, which saves me and calls normal function instead of loading. I get an error using this, like the undefined function or method for the input argument of 'structure', 'mtimes' can someone help me with error?

When you des2 = load ('c: \\ coeffs2.mat'); Then it creates a struct with des2 with the variable from 'c: \ coeffs2.mat' . Here's an example:

  & gt; & Gt; A = rand (3); & Gt; & Gt; B A & gt; & Gt; C = Load ('B') C = A: [3x3 Double]> gt; & Gt; Ca ans = 0.8147 0.9134 0.2785 0.9058 0.6324 0.5469 0.1270 0.0975 0.9575 If you do not want to use the structure, then use only  load ('c: \ coeffs2) instead .mat'); . Then there will be a variable  descr2  which you can use. Here's an example I used to create a file:  
  & gt; & Gt; Clear all & gt; & Gt; Load ('B') & gt; & Gt; Who is the size of the byte class a 3x3 72 double & gt; & Gt; A A = 0.8147 0.9134 0.2785 0.9058 0.6324 0.5469 0.1270 0.0975 0.9575    

No comments:

Post a Comment