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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
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]),:); % ...

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 1

| akzeptiert

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

mehr als 6 Jahre vor | 1

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 2

| akzeptiert

Mehr laden