Answered
Create multiple column vectors by entering a matrix?
Here is an alternative solution. Rather than littering your workspace with unnecessary variables and wasting memory simply creat...

11 years ago | 0

Answered
Extract rows in 3D matrix according to indexes
Perhaps you could try the values of the index vector directly: % index: idx = [2,3,1,2]; % fake data: X = reshape...

11 years ago | 0

Answered
how to check each value of matrix
Note that you can generate every output of your example in one command, where each row corresponds to one output: >> toepli...

11 years ago | 0

Answered
How to change color of vectors when plot a matrix?
Set the axes colororder property (here the colormap is |winter|, but you can choose the colormap to suit): N = 6; axes(...

11 years ago | 0

Answered
Interpolating with predefined max and min values
Easy, just use the <http://www.mathworks.com/help/matlab/ref/interp1.html#inputarg_method method option |'pchip'|>: yi = in...

11 years ago | 0

Answered
Splitting a vector into 'on' periods
This is fast and simple using |accumarray|: V = [1,2,3,4,0,0,0,0,5,6,7,4,7,8,0,0,0,1,2,5,4,0,0,0,0,0,5,6]; X = V>0; Y...

11 years ago | 0

Answered
Finding filename with only part of the name
You can use <http://www.mathworks.com/help/matlab/ref/dir.html |dir|> to search for files/folders, and it supports wildcard sear...

11 years ago | 0

Answered
Index exceeds matrix dimensions
Look at the size of |Data|: it does not have as many columns as you think it does, so when you try to access the second or third...

11 years ago | 0

Answered
how to get uicontrol value inside a callback function?
The easiest way would be to use <http://www.mathworks.com/help/matlab/matlab_prog/nested-functions.html nested functions>, then ...

11 years ago | 0

Answered
Cutting a certain pattern from an array
>> A = [1,2,3,4,5,6,0,0,0,0,1,2,3,4,5,6,7,8,9,10,0,0,0,0]; >> B = [0,0,0,0]; >> +strrep(char(A),char(B),'') ans = ...

11 years ago | 0

Answered
Problem with function_handle
You define |D| as a function: D = @(p)(exp(((p... but then later you use it as if it were a numeric (number): psi =...

11 years ago | 0

Answered
How to multiply a matrix by certain numbers?
Just use <http://www.mathworks.com/help/matlab/ref/bsxfun.html |bsxfun|>: >> X = [4 2 3 8;7 9 1 5;6 4 8 3]; >> Y = [4;8;...

11 years ago | 1

Answered
Using the max function to recieve two outputs
You need to use the second output of |max|, which is an index. Here are two ways of doing this: *With |find|* idy = find...

11 years ago | 1

| accepted

Answered
How to separate all negative and all positive values of a vector?
You don't need a loop, because <http://blogs.mathworks.com/steve/2008/01/28/logical-indexing/ logical indexing> is much simpler ...

11 years ago | 6

| accepted

Answered
How could I check that how many elements of x is inside y?
You can use <http://www.mathworks.com/help/matlab/ref/ismember.html |ismember|>: >> x = [2,7,8,11]; >> y = [1,2,4,5,7,8,...

11 years ago | 0

| accepted

Answered
Can variables used in defining a for-loop or an if-loop be used in the code block contained in said loops?
*Better Solution:* Rather than doing this using slow and bulky loops, why not learn how to use MATLAB effectively by writing ...

11 years ago | 0

Answered
Output Local Variables from a Function - R2, F-Test, Stats, etc.
Instead of calling the function like this: R2Ftest(X,Y) simply call the function with those outputs: [r,r2 h,p,ci,s...

11 years ago | 1

| accepted

Answered
Why this message error?
|cadf| does not seem to be an inbuilt MATLAB function, and you give no information about how it is defined or the output that it...

11 years ago | 0

| accepted

Answered
Storing values of a variable in a new one
_"How do I best go about going through this variable and storing the values of the different events in new variables"_ Don't....

11 years ago | 0

| accepted

Answered
Delete the folder existing in the matlab path
Use <http://www.mathworks.com/help/matlab/ref/rmdir.html |rmdir|>: rmdir(folderName,'s')

11 years ago | 2

Answered
How can I pass variable for to m-file when push button is pressed?
Here are the documents showing how to pass arguments between callbacks and functions: <http://www.mathworks.com/help/matlab/c...

11 years ago | 0

Answered
Cell array to ordinary array. cell2mat
You can use <http://www.mathworks.com/help/matlab/ref/str2double.html |str2double|> inside <http://www.mathworks.com/help/matlab...

11 years ago | 0

| accepted

Answered
How to create a big mat.file including many variables generated in a GUI
Of course you can save those variable directly from the GUI workspace. And yes it is inefficient to transfer them to the base wo...

11 years ago | 1

| accepted

Answered
how i can collect integers values only from out put
Why not just generate only the integer values in the first place: a = 9:35:429

11 years ago | 1

Answered
create 3D matrix from input file
This code will read the file data into two cell arrays, one containing the header numeric data, the other containing the indices...

11 years ago | 1

| accepted

Answered
Text objects and dot notation
Try removing the |handle|: hText = text(rand(10,1),rand(10,1),'test'); The <http://www.mathworks.com/help/matlab/ref/tex...

11 years ago | 0

Answered
how to overcome the error
As it suggests, change the code: conv2(double(A),double(B))

11 years ago | 0

Answered
defining the range of an inverse function
MATLAB does not support implicit multiplication, which means you cannot write multiplication as |3e|, you must write |3*e| toget...

11 years ago | 0

| accepted

Answered
pls help me shortened my code.. i really need your help. .Especially in the if elseif statement.
Here is the entire functionality in about twenty lines: Fs = 8000; t = 0.25; N = 1:ceil(t*Fs); % define DTMF: R...

11 years ago | 0

| accepted

Answered
How I convert a str to Num, and label them. please help me.
Perhaps you are looking for something like this: function num_arr = convert_to_num420(str_cell_arr) num_arr = zeros(size...

11 years ago | 0

| accepted

Load more