Answered
About size function -Syntax : [m,n] = size(X)
This often confuses beginners who do not bother to read the documentation. *Explanation* The important thing is that the _...

10 years ago | 1

| accepted

Answered
I dont get this; Unbalanced or unexpected parenthesis or bracket.; on my codes. What I did was putting'.' next to high-lighted X,Y.
|X.| is not valid MATLAB syntax. You cannot use |.| as part of a <http://www.mathworks.com/help/matlab/matlab_prog/variable-name...

10 years ago | 0

| accepted

Answered
I am unable to get my result due to error, and dont know how to fix it. please reply
The problem is this line: F=F(wn) because you reassign the variable |F|, and so it stops being a function that you can ca...

10 years ago | 0

| accepted

Answered
How to call dos commands from MATLAB command window?
Read the <http://www.mathworks.com/help/matlab/ref/dos.html |dos|> help page. The help explains how |dos| must be called, and it...

10 years ago | 0

Answered
How does MATLAB process M-Files?
The MATLAB documentation explains how MATLAB works: <http://www.mathworks.com/products/matlab/matlab-execution-engine/> <h...

10 years ago | 0

Answered
Creating a function that stores string after a certain string at the beginning of a line in a text file.
There is no need to use slow and ugly loops for this kind of basic file reading: fid = fopen('temp0.txt','rt'); C = text...

10 years ago | 0

Answered
How to clear all fitting settings?
It is your data. They are not in sequence along the X axis, and so this is how the Y values are plotted. Something like this:...

10 years ago | 1

| accepted

Answered
How to successively fill a matrix using a for loop?
In one line: TS = horzcat(ABS{1,:});

10 years ago | 0

| accepted

Answered
How to delete row from matrix, which has values 0 and 4?
u = [... 0 0 4 0 3 0 0 3 4 2 0 0 2 0 4 2 ...

10 years ago | 1

| accepted

Answered
Please, How to solve an equation has known variables to make the answer between known range of numbers?
C = [ 2, 3, 4]; % coefficients V = [10,20,30]; % values L = [140,145]; % limits % Create binary permutation matrix: ...

10 years ago | 0

| accepted

Answered
How to separate integers and decimal numbers from given values?
>> V = [1,2.3,4,5.6,7.8,9]; % fake data >> X = fix(V)==V; >> V(X) % integer values ans = 1 4 9 >> V(~X) ...

10 years ago | 1

Answered
How to store Images in array and read one by one?
<http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F> <http://www.mathworks.com/matlabcentral/answers/2...

10 years ago | 0

Answered
How to find non-zero indexes (or value) in row in matrix, and make taken results i and j elements of another matrix Dij?
A short version without explicit loops: >> [Ra,Ca] = find(A~=0); >> X = accumarray(Ra,Ca,[],@(n){n}); >> F = @(V)arr...

10 years ago | 1

Answered
fastest way to make cell array of node names
This takes 0.3 seconds to make a cell array of the integers 1:50000: cellstr(reshape(sprintf('%-10.0f',1:X),[],X).'); whi...

10 years ago | 1

| accepted

Answered
Find range between two array's indexes
Assuming that the rule really should pick the closest values from |A| that a re less than the values in |B|: >> A = [4192 2...

10 years ago | 0

| accepted

Answered
What is the meaning of A{1}
|A| is a cell array. |A{1}| is the content of that cell (in your example a numeric array). <http://www.mathworks.com/help/mat...

10 years ago | 0

Answered
Collect data in structure which contain structure with timestamps
Although it is not completely clear, you seem to be describing a scalar structure with multiple fields, each field contains one ...

10 years ago | 0

| accepted

Answered
Format output at Command window and Workspace inconsistent
They are not controlled by the same settings, so there is no reason why they have to be the same. It is possible that some featu...

10 years ago | 1

| accepted

Answered
How to select files that contain a particular string as part of their name?
The answer really depends on what you want to do: how do you plan on working with those filenames? Something like this might wor...

10 years ago | 1

Answered
log plot with positive and negative data with negative power
One way to solve this would be to plot the positive and (absolute) negative values in two separate axes. This would require: ...

10 years ago | 0

Answered
linkdata to structured data
*Solution* Yes it is possible, but you will have to either click the "Edit.." or "fix it" link in the figure, or by specifyin...

10 years ago | 1

Answered
Code doesn't work on latest version of matlab.
MATLAB function outputs can change between versions: <http://www.mathworks.com/matlabcentral/answers/292072-does-the-matlab-v...

10 years ago | 0

| accepted

Answered
Extracting specific repeating lines of text after a heading using fgetl and textscan
>> str = fileread('temp1.txt'); >> C = regexp(str,'(?<=> <KEY>\s+)\S+','match') C = 'RDHQFKQIGNG' 'JFJNNFNFKFNN...

10 years ago | 1

| accepted

Answered
extract rows of a matrix
idx = 1==mat(:,6); % create logical vector out = mat(idx,:); % use vector as logical index <http://blogs.mathworks.com/st...

10 years ago | 1

| accepted

Answered
How to Delete Rectangles with Loops
You are drawing every rectangle twice: once hardcoded before the loop, and once inside the loop. This means deleting one of them...

10 years ago | 1

| accepted

Answered
How to assign one variable value to another variable and sort out the variable with a loop?
output = DataX(Sample==1) If you want a full working version: N = 23; DataX = randi(9,1,N); Sample = randi([0...

10 years ago | 0

| accepted

Answered
negative with positive lookbehind regex issue
Try this regular expression: |(?<=\d+)(?<![OS]\d+)\(| It relies on the fact that lookaround operations do not consume any cha...

10 years ago | 0

| accepted

Answered
How to find which rows are identical in a matrix
>> A = [1 1 1 1; 1 0 0 1; 1 0 0 1; 1 0 0 0]; >> [~,B,C] = unique(A,'rows'); >> A(B(accumarray(C,1)>1),:) ans = ...

10 years ago | 1

| accepted

Answered
How do I skip an error in a loop?
You can use <http://www.mathworks.com/help/matlab/ref/try.html |try|>: for k = ... try your code here ...

10 years ago | 1

| accepted

Answered
How to create comparison matrices "comparing" strings from 6 different data sources?
Your data: array{1}={'111','113','111','111'}; array{2}={'111','', '221','221'}; array{3}={'111','113','' ,'113'}...

10 years ago | 0

| accepted

Load more