asebojapanese.blogg.se

Matlab r2015a error using view invalid input arguments
Matlab r2015a error using view invalid input arguments








My problem is solved, I thank all those who gave their time to solve my problem. My Function: function %matrice_return% = myFun(Q,R,S,T,U,V,W,X,Y,Z,ZZ) Load('C:\Users\Documents\MATLAB\myFile\matrice_Result.mat') Load('C:\Users\Documents\MATLAB\myFile\matrice_M.mat') Load('C:\Users\Documents\MATLAB\myFile\matrice_L.mat') Load('C:\Users\Documents\MATLAB\myFile\matrice_K.mat') Load('C:\Users\Documents\MATLAB\myFile\matrice_J.mat') Load('C:\Users\Documents\MATLAB\myFile\matrice_I.mat') Load('C:\Users\Documents\MATLAB\myFile\matrice_H.mat') Load('C:\Users\Documents\MATLAB\myFile\matrice_G.mat') This generates an M-function that can be run using COMSOL with MATLAB. Next go to the File menu and select Save, in the save window locate Save as type list and select Model File for MATLAB (.m). Set up the model using the graphical user interface, then save the model as an M-file. Load('C:\Users\Documents\MATLAB\myFile\matrice_F.mat') to get your first model implemented using the COMSOL API. Note: You can always call a function with fewer than the number of defined output arguments, but never with more. In fact, I get exactly the error you got, because I only defined myFun with three output arguments. However, if I call myFun with four output arguments, I'll get an error = myFun(1,2,3) Now I can call myFun like so: = myFun(1,2,3) Then, I save the function as "myFun.mat" on the Matlab path. %# myFun returs the pairwise sums of the input arguments I open the editor and define the function function = myFun(D,E,F) Thus, you have to check your function's signature to solve the problem. You'd get the same error if you'd call =sin(0), since sin is defined with 1 output only. To clarify: You get the error because you're asking for more output arguments than the function can supply. For example, for a function called 'myFun', which accepts F-P as inputs, and should return A-E as outputs, you write as the first line of the function function = myFun(F,G,H,I,J,K,L,M,N,O,P) Did you call your function function? This is a VERY BAD idea, since function is a reserved key word.Īssuming you have simply replaced the name of the function you want to call with 'function' in your example: You need to define input and output in the function definition.










Matlab r2015a error using view invalid input arguments