I have only made this code longer because I have not had the time to make it shorter
Top 1% contributor
Hello student from Korea!
Why don't you try this?
q = 4; % connect every qth point out of p points
mingon = 2*q + 1;...
Answered 12 months ago
I want to mean the matrix a based on the logical matrix b columnwise:
In other words this:
Asked 2 years ago
I am using fmincon to optimize a vectorized function (myfun) of five variables (x). This function has also some parameters (k, l...
Asked 3 years ago
Try to put outside the first loop:
K = fliplr(I);
Answered 9 months ago
Given matrix a of size |MxN| and matrix b of size |MxL| I want to get a matrix C of size |M x(N*L)|
which contains the column-w...
I am trying to run a global search optimization in order to minimize a function. When I run it, I receive the following error:
For a given set of data, how can I define which of those correspond to the 95% of the data which are around the mean value?
I have a vector:
a=[0 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 1 0 1 ];
in which I would like to count the "areas" of zeros and...
As the tittle suggests I am wondering if it is possible to circshift the columns of an array with a different shiftsize in each ...
I have the cell for example:
Suppose that I want find the edges of ones and of not ones such that I can divide an in areas the array. Suppose the array i...
I have written two codes in matlab:
The first one is:
Is there any way to use fprint with an exponential output field (e) for example:
and not get an output such as *3...
I am trying to create a ramp which is a part of a step function in order to plot it.
Merry Christmas to all of you.
I am trying to incorporate a legend in for loop.
my code is the following:
s=['T '; 'Pb...
I have a function. Suppose
in which A is an array of _2 x m_ elements and B is a vector of n elem...
I have a matrix Z 6x100x6 and I would like to store all the elements from the 6th and the 100th column them in vector.
So I do...
I would like to plot blackbody spectral emissive power against wavelength in different temperatures. For that reason, I assigned...
Inside a function I have a variable called name which is a char class. I want to generate a structure based on the string of var...
I am trying to write a simple class. The purpose of the class is to create a figure.
What I do is:
classdef myFig < ha...
Asked 12 months ago
I want to capture everything except the tokens:
|name|, |'_'| and |'.iv2'|
I have 4 cases of vectors inside an array that I want to index. All of them have trailing -1. I would like to index such pattern...
Below I have a logical vector:
t=[0 1 0 0 0 0 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 1 0];
which has 5 TRUE areas and 6...
I have the following simple example:
h=plot( x, y );
bO = brush(gcf);
I have created a script that calls a function and the last one assigns in the workspace a variable and this works perfectly.
I have designed a simple gui. This gui has a question and a Yes and a No answer.
I want my script to pause when I call the gui...
I have created this simple function:
% a is gcf
I have an array:
a=[1 1 1 1 1 1 1 10 1 1 1 1 1 1 12 1 1 1 1 3];
I want to make a while loop that does the following
I want to differentiate a function f and the calculate the derivative of f at value of x. How can I do that?
I am trying to build a matrix whose rows are as many as the length of D (see below) and whose columns vary. Because this is impo...