답변 있음
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...

6년 초과 전 | 0

| 수락됨

답변 있음
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...

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 0

| 수락됨

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

6년 초과 전 | 0

| 수락됨

답변 있음
If statement with or condition
if any(settimana < bdr) ... else ... end

6년 초과 전 | 0

| 수락됨

답변 있음
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...

6년 초과 전 | 0

| 수락됨

답변 있음
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...

6년 초과 전 | 0

답변 있음
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 ...

6년 초과 전 | 0

| 수락됨

답변 있음
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 ...

6년 초과 전 | 0

답변 있음
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 ...

6년 초과 전 | 0

| 수락됨

답변 있음
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]),:); % ...

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 0

| 수락됨

답변 있음
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...

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 0

| 수락됨

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

6년 초과 전 | 0

답변 있음
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 ...

6년 초과 전 | 0

| 수락됨

답변 있음
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...

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 0

답변 있음
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)...

6년 초과 전 | 0

| 수락됨

답변 있음
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 .....

6년 초과 전 | 0

| 수락됨

답변 있음
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 ...

6년 초과 전 | 1

| 수락됨

답변 있음
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...

6년 초과 전 | 1

답변 있음
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...

6년 초과 전 | 0

| 수락됨

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

6년 초과 전 | 0

| 수락됨

답변 있음
Adjusting the resolution of the time vector
Try pdeval and supply the solution of pdepe

6년 초과 전 | 0

답변 있음
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...

6년 초과 전 | 0

답변 있음
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 = ...

6년 초과 전 | 0

답변 있음
How to obtain the original matrix after performing symrcm or symamd in MATLAB?
Can you share the symV original matrix?

6년 초과 전 | 0

| 수락됨

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

6년 초과 전 | 0

| 수락됨

답변 있음
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)

6년 초과 전 | 2

| 수락됨

더 보기