Respondida
How can I extract a signal between zero up-crossings
You can take a look at this post, where zero crossing is discussed in details https://it.mathworks.com/matlabcentral/answers/26...

más de 6 años hace | 0

| aceptada

Respondida
Unique ID Min and Max with multiple values per Unique ID
Tessa, look if this fits your problem % col vector M1 = [10 17 201 333 1000].'; M2 = [10 10 17 17 17 201 1000; 0.1 69 1.7 33...

más de 6 años hace | 0

Respondida
split dataset with probability weights
datasample has a two outputs, where the second is the index to the selected data in your npop1. So: [rw1,idSelected] = datasamp...

más de 6 años hace | 0

| aceptada

Respondida
select certain matrix elements
You can simply concatenate your ranges using square brackets: A([1:10 20:30],1)

más de 6 años hace | 0

| aceptada

Respondida
If statement with or condition
if any(settimana < bdr) ... else ... end

más de 6 años hace | 0

| aceptada

Respondida
Setting min value of variables within a function
Maybe I don't understand correctly: if you want to set all negative entries of fval to 0 you can add fval(fval < 0) = 0; at th...

más de 6 años hace | 0

| aceptada

Respondida
How do I make a 21x21 array from the center of a 200x150 array?
% dimensions n = 21; % rows m = 21; % cols % load image A = imread('grayscale.png'); % find center coordinate iCen...

más de 6 años hace | 0

Respondida
Create a matrix on the basis of other matrix
% your data SPI = [2 3 4 8 11 13 14 15 16 18 19 20]; AA = [1 2 3 4 0 11 14 15; 0 0 0 8 13 16 0 0; 0 0 0 0 ...

más de 6 años hace | 0

| aceptada

Respondida
How to i produce a signal which is a combination of three sinusoidal signal oscillate a frequency?
% frequencies f = [10 100 200]; % random amplitudes V = rand(3,1); % random phase phi = 2*pi*rand(3,1); % time axis ...

más de 6 años hace | 0

Respondida
Create an array from others matrix
You can just append the matrices as they come. a=100; b=5; N=8; % inital empty matrix PM = []; % your loop for sec=1:a ...

más de 6 años hace | 0

| aceptada

Respondida
Problem with while loop
% make matrices of the same length n1 = size(S1,1); n2 = size(S2,1); S1 = S1(min([n1,n2]),:); S2 = S2(min([n1,n2]),:); % ...

más de 6 años hace | 0

Respondida
Create a matrix on the basis of other matrix
Under the assumption that the "diversity" contains the same number of entries each row for i = 1:size(M,2) b(:,i) = unique...

más de 6 años hace | 0

| aceptada

Respondida
problem with fzero in my code
your fun is neither acceppting nor using inputs You should write the symbolic function like this fun = @(x)cos(x); x0 = fzero...

más de 6 años hace | 0

Respondida
how can i slove this proplem "- The vector V is given by V=[2 8 7 3 1 0 8 9]. Write down a single instruction to produce a vector that contains 1 in the place of the odd numbers and -1 in the place of the even numbers."
A suggestion: you can easily find the reminder of the division by 2, so that even numers have reminder 0 and odd numbers reminde...

más de 6 años hace | 0

| aceptada

Respondida
Operands to the || and && operators must be convertible to logical scalar values.
If you work with arrays, use the single & and not &&

más de 6 años hace | 0

Respondida
How to use fzero in a loop to obtain the first 3 positve solutions for cos3x=sin3x?
fzero gives you only one solution. In case of multiple roots, the choice depends on the initial choice and on the algorithm. If ...

más de 6 años hace | 0

| aceptada

Respondida
how to write a code to extract a positive latitude value for the corresponding positive longitudinal cell value
% filter idx = longitudinal >= 50 & longitudinal <= 100 & latitude >= 0 & latitude <= 40; % selection longitudinal2 = longi...

más de 6 años hace | 0

Respondida
Making a vector out of all even and odd numbers using for, if
This happens because the original vector contains random numbers that change every time you run the code. So, also the number of...

más de 6 años hace | 0

Respondida
Error using plot Vectors must be the same length.
Some comments 1) Q is defined twice as symbolic variable, but it is actually an array 2) in the first loop N = 4, so length(t)...

más de 6 años hace | 0

| aceptada

Respondida
Optimisation of function containing matrix
While waiting for the data, I try to solve one of the questions. you can set the missing constraint as x1-x2 = 0 x2-x3 = 0 .....

más de 6 años hace | 0

| aceptada

Respondida
How to plot points on a line
I suggest you to check hold on, and the LineSpec of the command plot % your data new = rand(5,1); % open figure and retain ...

más de 6 años hace | 1

| aceptada

Respondida
How to break an image into blocks?
Three assumprions 1) the image is a 2d matrix 2) the row/cols have 64x3, 3x64 and 3x3 blocks 3) you want 10 sub images, not 1...

más de 6 años hace | 1

Respondida
Optimization problem using external program
I can figure out two solutions 1) check if the simulation program has API for running it from "outside". In this case, make ref...

más de 6 años hace | 0

| aceptada

Respondida
Intersections between 2 graphs
Try this software on fex https://it.mathworks.com/matlabcentral/fileexchange/11837-fast-and-robust-curve-intersections

más de 6 años hace | 0

| aceptada

Respondida
Adjusting the resolution of the time vector
Try pdeval and supply the solution of pdepe

más de 6 años hace | 0

Respondida
Why my integration is like this?
You are calulating an indefinte integral that has an integration constant by definition. Matlab int command doesn't add the inte...

más de 6 años hace | 0

Respondida
Calculate the angle between plane normal and a point it cuts
using the definition of dot product: % angle function in radians ang = @(u,v)acos(dot(u,v)/(norm(u)*norm(v))); % data u = ...

más de 6 años hace | 0

Respondida
How to obtain the original matrix after performing symrcm or symamd in MATLAB?
Can you share the symV original matrix?

más de 6 años hace | 0

| aceptada

Respondida
Create an array from other array
x = [-V(:) -M(:)]; The column operator here reshapes the vector into a column vector

más de 6 años hace | 0

| aceptada

Respondida
Cumalative sum of each row of the matrix and the matrix array, separately
For the matrix Msum = cumsum(M,2) For the cell array Gsum = cellfun(@cumsum,G,'UniformOutput',false)

más de 6 años hace | 2

| aceptada

Cargar más