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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
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 (...

mehr als 6 Jahre vor | 1

Beantwortet
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];

mehr als 6 Jahre vor | 1

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

mehr als 6 Jahre vor | 0

Beantwortet
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;

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 1

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 1

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 2

| akzeptiert

Beantwortet
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,:)

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 1

Beantwortet
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(...

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

Beantwortet
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(...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
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')

mehr als 6 Jahre vor | 0

| akzeptiert

Mehr laden