Answered
counting number of inputs
Use a variable as a counter. E.g., suppose the variable name was guesses. Start with guesses=0 and then do guesses=guesses+1 fo...

11 years ago | 0

Answered
How to delete a submatrix from a matrix using the ZEROS command instead of [ ] square brackets?
Using explicit brackets [ ] on the right hand side of an equation combined with using indexing on the left hand side variable is...

11 years ago | 0

Answered
how to get the value a number at a specify decimal position ?
Use sprintf, find the decimal point, then get the desired digit after the decimal point. That being said, realize that for some...

11 years ago | 0

| accepted

Answered
How to aggregate two columns
This is how one would do it if A and B are doubles: C = A*1e8 + B; However, each of A and B has 8 decimal digits, so the...

11 years ago | 0

Answered
Are there any function to check a string in the argument list?
any(cellfun(@isequal,varargin,repmat({'off'},size(varargin))))

11 years ago | 0

| accepted

Answered
out of memory because of large matrixs and vectors
Please show the code you are using to create these vectors and matrices. Are you sure you are not inadvertently attempting to cr...

11 years ago | 0

Answered
Average of the Vector elements in the matrix
Assuming you are averaging every 20 elements, not a sliding window: A = your 815 x 440 matrix m = mean(reshape(A',20,[])...

11 years ago | 0

Answered
Vector Matrix multiplication (Row wise)
L = bsxfun(@times,L,V);

11 years ago | 0

Answered
concatenation of multiple vector variables and display in a single matrix variable
E.g., R_values = 1 x X vector of peak values R_locations = 1 x X vector of peak locations R_distances = 1 x X vector ...

11 years ago | 0

| accepted

Answered
Why won't my code run.
How are you calling bisec? From the error message, it looks like you are not providing all of the inputs. E.g., if you only di...

11 years ago | 0

Answered
basic knowledge question for loops
You made a decent start so I will help. Your code paired up with the instructions: a= zeros(1,5) b= [1 2 3 4 5] for i...

11 years ago | 0

Answered
y=e.^(-2*time)*[24*cos(4*time)-40*sin(4*time)]
Try this: y=e.^(-2*t​ime).*[24*c​os(4*time)​-40*sin(4*​time)] % <-- changed )*[ to ).*[

11 years ago | 0

Answered
How to use Matlab to calculate the huge matrix?
5e10 ... that's about 17 zetta bytes ... or 17 giga-tera bytes. This is WAY WAY beyond what you can expect with any computer. Y...

11 years ago | 0

| accepted

Answered
Comparing the two matrices
Not sure what B is. But if you want to replace the 1's in H with numbers from L, then x = (H == 1); H(x) = L(x);

11 years ago | 0

Answered
Undefined function or method 'sparameters' for input arguments of type 'char'
sparameters appears to be in the RF Toolbox ... do you have this installed? Also, your gamma is only a single value, 0.3800 + 0...

11 years ago | 0

| accepted

Answered
How to do this one..??
Put the numbers into a vector, sort the vector, then make assignments to your variables from this sorted vector. http://www.m...

11 years ago | 0

| accepted

Answered
Comparing values from structure to a scalar
Considering this line: if results(i).A.bus(:,8)>1.1 It looks like a vector expression to me, which means it is equivalen...

11 years ago | 0

Answered
Why can I not evaluate this while loop?
Did you mean to use cosd instead of cos? From your w values it looks like maybe w is in degrees. Also, I don't see x or y initia...

11 years ago | 0

| accepted

Answered
I AM GETTING FOLLOWING ERROR WHEN I RUN MY CODE ...... Assignment has more non-singleton rhs dimensions than non-singleton subscripts
How are these lines supposed to work? s1(i,1)=[h(361) h(362) h(363)]; s2(i,2)=[h(223) h(224)]; s3(i,3)=[h(249) ...

11 years ago | 0

Answered
Generate random number between 0 and a non-integer value
rand * your_non_integer_value

11 years ago | 0

| accepted

Answered
How to share p code in FileExchange (or protect my work)
Allowing the use of DLLs, MEX file, or p-files generally goes against the philosophy of the FEX. First, as a user it is much har...

11 years ago | 3

Answered
Why am I getting an error "vectors must be the same length"
plot(x,f(x),x1,f(x1)); % Changed last f(x) to f(x1)

11 years ago | 0

Answered
ODE 45 with matrices
CPi is 0, so x(3) in your parte function is 0, so x(3)^(-0.5) is inf (the A(1,3) element). This leads to all of your NaN results...

11 years ago | 0

Answered
MATLAB: I'm having trouble calculating the probability to estimate pi. Any help is appreciated.
You have made a decent start. Issues with your code: 1) You use _counter_ for two separate conflicting things. One is the loo...

11 years ago | 1

| accepted

Answered
How do I even do this? Inverse Model Matrix
To solve the linear system A*x = b for x with matrix A and column vector b known, using the inv function: x = inv(A) * b; ...

11 years ago | 1

Answered
MATLAB mexCallMatlab causes crash
I don't know if I caught everything, but here are some issues: ---------------------------- double *pad, *windowSize, *t...

11 years ago | 0

Answered
clear persistent variables in sub-functions
What happens if you clear MyMainFunction? (Or clear functions)

11 years ago | 0

Answered
Undefined function 'Fun" for input argument of type 'double'?
I see a "fun" but I don't see a "Fun" anywhere. Do you have a file Fun.m that you are trying to call? Or are you trying to call ...

11 years ago | 0

| accepted

Answered
Why am I not getting all the outputs mentioned in my function ?
Are you calling the function with three outputs? E.g., nt = 3; [rs2,x,y] = rwn(nt);

11 years ago | 0

Answered
Can A = A + B'*B be sped up somehow? It is seriously bottlenecking my for-loop
If you have a C compiler available, another option is to call a BLAS routine from within a mex function to do this calculation. ...

11 years ago | 2

| accepted

Load more