Answered
Grouping Data: How do I group all the rows with the same number on the second column together?
For a single group's mean mu = mean(m(m(:,2)==1,3)); % 1 2 3 4 % 1: the variable name of your matix % 2: colum...

7 years ago | 0

Answered
A data processing problem
% Determine where BSid values change deltaBSid = diff(I.BSid)~=0; % Create a logical vector identifying the first and last r...

7 years ago | 0

| accepted

Answered
Sorting a data set to report failing values in pairs instead of individually
I think you're looking for.... % Coordinates you're keeping keepCoordinates = A(i2keepHS_HS2, :); % Coordinates you're no...

7 years ago | 0

| accepted

Answered
contextmenu in axes in GUI
Follow the example described in the documentation (link below). This code will go in your OpeningFcn function. https://www.m...

7 years ago | 0

Answered
Assigning row to array using cellfun
Here's your loop, within cellfun(). A = cellfun(@(x)[x(1:counter-1,:);B;x(counter+1:end,:)], A, 'UniformOutput', false);

7 years ago | 0

| accepted

Answered
Taking 1d cuts of data along polar contours
Your data are quite coarse. You can see the unit squares that make up each coordinate. So, you won't be able to create a perfe...

7 years ago | 0

| accepted

Answered
Read .txt and Write in matab
Read in the whole file at once. In this example I'm using fileread() because I'm unfamiliar with the FEX submission readfile() ...

7 years ago | 0

Answered
about function rats and how to output to .txt
a1 = strtrim(rats(a/pi)); Use strtrim() to remove leading and trailing white space.

7 years ago | 1

| accepted

Answered
Finding change point of an array values
There are probably some smart algorithms that will be helpful (Image Analyst mentioned some hints). But here's a lower-level s...

7 years ago | 0

| accepted

Answered
How to find values greater than a number in a cell of empty cells?
D = {[],[],3,[], -2, 0, [], 1, 6, []}; idx = cellfun(@(x)~isempty(x) && x >= 0, D); % logical index If you need the subscript...

7 years ago | 0

| accepted

Answered
Invalid data type. First argument must be numeric or logical.
My guess is that.... [RT_CD_row,RT_CD_col]=size(RT_CD_Data); for C=1:1:RT_CD_row RT=(RT_CD_Data{C,1}); % ...

7 years ago | 0

Answered
Find the perfect overlay of 2 maps of points
You can compute the difference between the x values from each set and the y values from each set which will create a matrix of o...

7 years ago | 0

Answered
How do i change my script to print out the second word of each even line?
Instead of reading the file line by line you could read in the entire text file and then extract the 2nd word from even numbered...

7 years ago | 0

| accepted

Answered
reshaping error after clustering pixels > 0 in image
I understand the problem but I don't have an entirely clear picture of what the imIDX variables should be. I think all you ne...

7 years ago | 0

| accepted

Answered
Changing the transparency of a plot line, saved in a fig file
Manually edit each line object The easiest method would be to open the fig file, use the pointer to select the line you'd like ...

7 years ago | 3

| accepted

Answered
Vector against a single value
% Create fake data for testing for i = 1:10 a(i).timevector = rand(8192,1); a(i).power = randi(10)+5; end % Creat...

7 years ago | 0

| accepted

Answered
How to make 2 legends
There are few ways to create a pseudo legend. One way is to plot your data on the main axes but instead of creating a legend fo...

7 years ago | 0

| accepted

Answered
Skipping if Statement even though a has been set to 0, on matlab GUI
a = get(handles.A_Value,'String'); % a is a string, not a number. % Option 1 is to convert a to a number a = str2double(ge...

7 years ago | 1

| accepted

Answered
plot the first sample with different color
plot(Fun(:,1)Fun(:,2),'.r-') hold on plot(Fun(1,1)Fun(1,2),'.g') % if you want the first coordinate % -OR- plot(Fun(1:2,1...

7 years ago | 0

| accepted

Answered
How can i plot an inline function?
As explained in the documentation, inline() will be removed in the future. Use anonymous functions instead. Here's the form...

7 years ago | 0

Answered
How to only select the last x number of columns when trying to concatenating a matrix using a for loop
"I do not know how to tell matlab to only take the last 31000 elements of each coloumn of each cell" To take the last n column...

7 years ago | 0

| accepted

Answered
Error function definitions are not permitted in this context
It appears that you're running copy-pasted code directly from the command window. Function definitions are not supported from t...

7 years ago | 1

| accepted

Answered
how to multiply data to the aplitude of each pluse of multiple cycles of a signal??little emergency please reply fast
Before we get into the solution, here's a few comments about the code. Your loop isn't doing anything useful. It's overwritten...

7 years ago | 1

| accepted

Answered
Trying to sort a text document by alphabetical order and count how many times a word appears
Here's a different approach. See inline comments for details. % Read text C = fileread('Theodore_Roosevelt_The_Duties_Of_Ame...

7 years ago | 0

| accepted

Answered
Counting pixels of colored objects in an image
The reason why the 2nd attempt doesn't work is because you're trying to match exact color values but your image clearly has many...

7 years ago | 0

| accepted

Answered
Reset or clear property values in App Designer
The callback to your app button can do 3 things. Open a new instance of the app but make is invisible. All properties will be...

7 years ago | 0

| accepted

Answered
REPEATED MEASURES ANOVA MATLAB
Is repeated measures anova the best way to go? Your design is certainly applicable to a repeated measures design but the answer...

7 years ago | 5

| accepted

Answered
how creat random text file
Another idea is to use randsample() to create random letters in the form of words separated by randomized spaces. This function ...

7 years ago | 1

Answered
how to use Discretize syntax
data = randi(29,100,1); % demo data (100 values between 1:29 g = discretize(data, 1:4:29) % g is the group number...

7 years ago | 0

Answered
Function of vector with letter grade
Here, you can enter any type of numeric input from scalars, vectors, matricies, to n-dimensional arrays and the output will be t...

7 years ago | 2

Load more