Login
Password
Sources on this Page

> Headlines by Category

 Home / Science / Mathematics

You are using the plain HTML view, switch to advanced view for a more complete experience.

Re: Code whats the Error?
On 9/28/2016 4:42 PM, nilima saran wrote:
> [Ainv]=INVMAT(A)
> [n,n]=size(A);I=zeros(n,n);
> for i=1:n;I(i,i)=1;end
> m(1:n,1:n)=A;m(1:n,n+1:2*n)=I;
> for i=1:n;m(i,1:2*n)=m(i,1:2*n)/m(i,i);
> for k=1:n;if i~=k
> m(k,1:2*n)=m(k,1:2*n)-m(k,i)*m(i,1:2*n);
> end;end;end
> invrs=m(1:n,n+1:2*n);
> I am getting an error at line 2
> Error using INVMAT (line 2)
> Not enough input arguments.
>


See https://www.mathworks.com/matlabcentral/newsreader/view_thread/291732

You must be using the function "INVMAT" as in the question above.

--Nasser
Code whats the Error?
[Ainv]=INVMAT(A)
[n,n]=size(A);I=zeros(n,n);
for i=1:n;I(i,i)=1;end
m(1:n,1:n)=A;m(1:n,n+1:2*n)=I;
for i=1:n;m(i,1:2*n)=m(i,1:2*n)/m(i,i);
for k=1:n;if i~=k
m(k,1:2*n)=m(k,1:2*n)-m(k,i)*m(i,1:2*n);
end;end;end
invrs=m(1:n,n+1:2*n);
 I am getting an error at line 2
Error using INVMAT (line 2)
Not enough input arguments.
Vector norms converted to vector components
Hello, I have a question that gives me that the norm of v=2 and the norm of w=7 then it asks what the smallest and largest values that can result from the norm(v-w) and also the smallest and largest values of dot(v,w) any tips?
Re: matrix multiplication with for loop
On 09/28/2016 1:10 PM, Margaret Burns wrote:
...

> I do not want to use A*B. I am assuming that I would do so with a series
> of nested for loops?

Yes, into an accumulator for each output location. Remember the output
size is dependent upon the input size/shape.
matrix multiplication with for loop
I am trying to figure out how to multiply/ divide matrices without the use of matlab's built in functions as an exercise and am completely lost on how to do so.

say
A=[1 2 ; 3 4];
B= [5 6;7 8];

I do not want to use A*B. I am assuming that I would do so with a series of nested for loops?
Re: TodaysDate = datestr(now,'yymmdd') does not work in version 8.2.0.701 (R2013b)---works in version Version 8.2 (R2013b) WHAT'S UP?
Karen Henneke" wrote in message <nsgg7n$7vq$1@newscl01ah.mathworks.com>...
> TodaysDate = datestr(now,'yymmdd') does not work in version 8.2.0.701 (R2013b)---works FINE in version Version 8.2 (R2013b) WHAT'S UP? COME ON WITH THE DATE STUFF
>
> Error in datestr (line 126)
> narginchk(1,4);
> Output argument "S" (and maybe others) not assigned during call to
> "C:SoftwareMathworksMatlab_All_Products_2013B_PSP_72toolboxmatlabtimefundatestr.m>datestr".

I was not able to reproduce this error using release R2013b.

Please check that you haven't created your own NARGINCHK function (or downloaded a version of that function) that is shadowing the one included with MATLAB. You can do this using the following command.

  which -all narginchk

The text displayed by that command should list only the built-in function included in MATLAB. If you see something else, try renaming or removing it and see if you can still reproduce the problem.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on http://www.mathworks.com
Re: Canalyzer log file to mat file conversion
Hi Reid,

I would be really grateful if you could send me the scripts (nunzia.lorusso.nl90@gmail.com)
Re: fmincon: final result is worse than initial guess
Then I suggest you to submit the BUG report.
Appending structure dynamically in loop
Hi everyone.

I a bunch of data structures with an id (id1, id2, id3, ... idN) a single data field that contains variables (var1,var2,var3, ... varK), such that the first structure looks like

id1.data.variable1 = []
id1.data.variable2 = []
.
.
.

All id's share the same data and variable structure.

Now, I would very much like to append a new variable (newvar) to these existing structures in a loop.

For one structure, I would just do this:

id1.data.newvar1 = id1.data.var1^2

which would add newvar1 to my id1.data with id1.data.var1^2 as values.

If i try

for i = 1:length(id_list)
      id_list{i}.data.newvar = id_list{i}.data.var1^2
end

I get a "Struct contents reference from a non-struct array object." error.

Any input is appreciated.
TodaysDate = datestr(now,'yymmdd') does not work in version 8.2.0.701 (R2013b)---works in version Version 8.2 (R2013b) WHAT'S UP?
TodaysDate = datestr(now,'yymmdd') does not work in version 8.2.0.701 (R2013b)---works FINE in version Version 8.2 (R2013b) WHAT'S UP? COME ON WITH THE DATE STUFF

Error in datestr (line 126)
narginchk(1,4);
Output argument "S" (and maybe others) not assigned during call to
"C:SoftwareMathworksMatlab_All_Products_2013B_PSP_72toolboxmatlabtimefundatestr.m>datestr".
Post Selected Items to:

Showing 10 items of 538

home  •   advertising  •   terms of service  •   privacy  •   about us  •   contact us  •   press release design by Popshop •   Official PR partner PRNews.io •   © 1999-2016 NewsKnowledge