Respondida
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...

casi 11 años hace | 0

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

casi 11 años hace | 0

| aceptada

Respondida
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...

casi 11 años hace | 0

Respondida
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,[])...

casi 11 años hace | 0

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

casi 11 años hace | 0

Respondida
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 ...

casi 11 años hace | 0

| aceptada

Respondida
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...

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

Respondida
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 ).*[

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

| aceptada

Respondida
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);

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

| aceptada

Respondida
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...

casi 11 años hace | 0

| aceptada

Respondida
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...

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

| aceptada

Respondida
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) ...

casi 11 años hace | 0

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

casi 11 años hace | 0

| aceptada

Respondida
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...

casi 11 años hace | 3

Respondida
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)

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 1

| aceptada

Respondida
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; ...

casi 11 años hace | 1

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

casi 11 años hace | 0

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

casi 11 años hace | 0

Respondida
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 ...

casi 11 años hace | 0

| aceptada

Respondida
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);

casi 11 años hace | 0

Respondida
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. ...

casi 11 años hace | 2

| aceptada

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

casi 11 años hace | 0

Respondida
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) = [];

casi 11 años hace | 0

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

casi 11 años hace | 0

Cargar más