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

Answered
Random no matrix for 1 & -1
Another way: fm_array = 1 - 2*(rand(nrows) < 0.5);

11 years ago | 0

Answered
How do I remove '1x1 cells' from a cell array?
Try this (caution, untested): cell_array = your cell array; x = cellfun(@numel,cell_array); cell_array(x==1) = [];

11 years ago | 0

Answered
Matlab programme for central limit theorem
See these links: http://www.mathworks.com/matlabcentral/answers/232052-simulating-the-central-limit-theorem-with-non-uniform-...

11 years ago | 0

Answered
random numbers between a and b with specified mean and variance
1) a + b*rand() creates a value between a and a+b, not between a and b. 2) The values will have a uniform distribution with m...

11 years ago | 2

| accepted

Answered
Why is MyCellArray{:} different than x = MyCellArray{:}?
MyCellArray{:} is a comma separated list. It is equivalent to typing the following: MyCellArray{1},MyCellArray{2},MyCellArr...

11 years ago | 1

Answered
Index exceeds matrix dimensions
This line: YC= YC(:,:,i); replaces the original multi-page YC with only *one* page of YC the first time through the loop...

11 years ago | 0

| accepted

Load more