Respondida
How to put a variable equal to a vector in an if cycle
My guess % your data TIMEFAILURECOG= [2 4 10 50]; Matrixdiff=[0,TIMEFAILURECOG]; DIFFERENCE=diff(Matrixdiff); INDEXCOG1=fin...

más de 6 años hace | 0

| aceptada

Respondida
Invalid indexing when simplifying a symbolic expression
C is used as a function C(k3r+k4f)

más de 6 años hace | 0

Respondida
Could anyone help me to solve the issue.
For your case NN = mat2cell(A,[1 1 1],2) A bit more general NN = mat2cell(A,ones(size(A,1),1),size(A,2))

más de 6 años hace | 0

Respondida
how to plot a fitness or objective function with optimum values
objFun = @(x)100.*(x(:,1).^2 - x(:,2)).^2 + (1 - x(:,1)).^2; conFun = @(x)[x(:,1).*x(:,2)+x(:,1)-x(:,2)+1.5, 10-x(:,1).*x(:,2...

más de 6 años hace | 0

| aceptada

Respondida
Multi-objective optimisation using results from external simulation
Look at this video https://www.youtube.com/watch?v=Lgjf0vWl7Ik it seems the author is doing a similar data exchange between Di...

más de 6 años hace | 0

Respondida
Recall elements inside the rows of a matrix based on a predefined array
A = M(V,:);

más de 6 años hace | 0

| aceptada

Respondida
how to draw a 3d surface of exp(x+iy)
Suppose that you want to plot the magnitude of the exp(z) % setup the range of your plot in x and y (-2,2) and the resolution (...

más de 6 años hace | 1

Respondida
could anyone help me how to display the position of all the numbers present in matrix.
[iRow, jCol, value] = find(A); then you can put them in a matrix, if you like position = [value, iRow, jCol];

más de 6 años hace | 1

Respondida
could anyone help me to calculate the euclidean distance for the matrix.
I have found that this is usually the fastest way, since the square of the binomial is unrolled D = sqrt(abs(bsxfun(@plus,sum(A...

más de 6 años hace | 0

Respondida
Take values from an matrix automatically.
Prog_old = Prog; % modify Prog as desired Prog = Prog*2; % dummy operation % reload the old version Prog = Prog_old;

más de 6 años hace | 0

Respondida
picking up data file in each iteration
Following Stephen link numFiles = 200; for k = 1:numfiles fileName = sprintf('s%d.mat', 1008+10*k); data = load(fileNa...

más de 6 años hace | 1

Respondida
Filling gaps in time series with Nan
For the particular case % preliminary setup newData = [1:10; NaN(1,10)]'; % fill-in newData(data(:,1),2) = data(:,2) To m...

más de 6 años hace | 0

| aceptada

Respondida
Removing char in a mixed string column so only numerical values are left?
Check erease erease(yourString,'LED');

más de 6 años hace | 1

Respondida
Separating of succecive monotonic vectors
Let's assume your data are stored in x and y vectors. I take them from your picture % get the data from picture fig = gcf; ax...

más de 6 años hace | 0

| aceptada

Respondida
How to stop annoyed messages in command window?
I have a similar problem with Mac because I installed a package to manage split screen, named BetterSnapTool. For Linux, see if...

más de 6 años hace | 0

| aceptada

Respondida
Make a program to convert a number to decimal, octal, hexadecimal and binary value
You can use the functions bin2dec dec2bin hex2dec dec2dex and the more general dec2base base2dec

más de 6 años hace | 0

| aceptada

Respondida
How to assign a different name of a matrix for each iteration?
Don't use this sintax (for details, see https://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not...

más de 6 años hace | 2

| aceptada

Respondida
remove specific rows by referencing on the first digit of each row.
index = 1; % A(:,1) == index finds the rows with specific value (logical indexing) B = A(A(:,1) == index,:)

más de 6 años hace | 0

Respondida
delete and insert entries in a vector
If A is a matrix, I assume you have column vectors, if not, please provide A % your (column) vector c = [1 1 3 4 5 6 7 8 11 10...

más de 6 años hace | 0

| aceptada

Respondida
combining different size arrays based on time dimension and compute average for the last column
find rows in M2 that are present in M1 (assuming that all rows in M2 are present in M1 [~,iRows] = ismember(M2(:,1:4),M1(:,1:4)...

más de 6 años hace | 0

| aceptada

Respondida
Sort of peak analysis
If the signal is not too noisy you can work with ‘diff’ and look for the change of sign

más de 6 años hace | 1

Respondida
How to improve the accuracy of lu decomposition?
It's a weird way to check the accuracy. What about checking the norm of the residual % data N = 5; A = rand(N)+eye(N)+1j*rand(...

más de 6 años hace | 0

Respondida
How to write a matlab function to find largest jump between consecutive vectors without using max or min
Try xd = abs(diff(x)) [K,y] = max(xd)

más de 6 años hace | 0

Respondida
matrix multiplication for "3-D" matrices
Let's start saying that the data structure you are using is not the best one. See https://www.mathworks.com/matlabcentral/answer...

más de 6 años hace | 0

Respondida
MATLAB doesn't let me plot 3 graphs in the same plot
As Guillame pointed out, you just have to plot them (without the indexing): h = figure; hold on, grid on plot(t,v); plot(t...

más de 6 años hace | 0

Respondida
MATLAB doesn't let me plot 3 graphs in the same plot
The problem is here plot(tm,ve(i+1),'green') ... plot(tn,vi(i+1)) ve(i+1) is a number, as well as vi(i+1), while tm and tn a...

más de 6 años hace | 0

Respondida
Best way to calculate the determinants of a series of matrices?
Not sure if it you can speedup your code, but a single line code to do the job is Delta = arrayfun(@(i)det(squeeze(G(i,:,:))),1...

más de 6 años hace | 0

Respondida
Compute execution time without printing statement?
You can just save the value in a variable timerValue = tic; % something very useful to do tstop = toc(timerValue);

más de 6 años hace | 0

Respondida
Extract data in a single vector after a FOR cycle
Ciao, You can try to reshape your data, then apply max on the columns media_reshape = reshape(media,85,113); max_media = max(...

más de 6 años hace | 0

| aceptada

Respondida
Comparing Duration Arrays is time consuming - How to improve my script?
Not sure if I understand correctly the problem without data. I try: idx = find(clock > tdur(1),1,'first')

más de 6 años hace | 0

| aceptada

Cargar más