Answered
How to create zoom in/out for GUI MATLAB
amir - it isn't entirely clear (to me) why your code for each pushbutton is checking something called *handles.aa* and then deci...

9 years ago | 0

Answered
Generate 1 matrix from 3 data columns
Jess - if *z* is your third column, then you could do something like flip(reshape(z, [3 3])',1) We re-shape *z* from a 9x...

9 years ago | 1

Answered
Extract or keep rows based on an array.
Kellie - if we can assume that your *A* is constructed as a cell array like A = {1 'cat' 24; 1 'dog' 2; 2 'horse' 0; 2 'dog...

9 years ago | 1

Answered
How to find indices of similar elements in a vector?
Syed - try the following x = [1 1 2 2 3]; groupedData = arrayfun(@(y)find(x == y), unique(x), 'UniformOutput',false); I...

9 years ago | 0

Answered
Using a while loop to find the total of a alternating series when the difference in membrs becomes .001 or less.
Spenser - part of the problem is how you treat your *total* and *error* variables. Are they scalars or arrays? You initialize ...

9 years ago | 0

Answered
Load multiple files, but it only returns the data in last file
Ivy - on every iteration of your *for* loop, you are resetting *data* data=zeros(1600,2459); which then will only retain ...

9 years ago | 0

| accepted

Answered
Why does the function call "function [hdr, record] = edfReadOddur( 'tinnaprime.edf',varargin )" give an error?
Oddur - if your function signature (the first line in edfReadOddur.m) is written as function [hdr, record] = edfReadOddur( '...

9 years ago | 1

| accepted

Answered
How can I subscript part of simple string in Matlab? This text is not related to figure in Matlab. Any help will be appreciated.
sorayya - if you want to access certain characters of a string, then you could do sText = 'Helloworld'; cText = {sText(1:4...

9 years ago | 0

Answered
How to find intersection between two outputs?
balandong - remember, the data that you are plotting are doubles and you are drawing a curve where every two consecutive points ...

9 years ago | 1

Answered
How to efficiently Assign Value to column vector?
balandong - your first *for* loop is for i = 1: length (tf) M (i,1) = Height (tf(i)); end Try replacing this with ...

9 years ago | 1

| accepted

Answered
Heun's method program code
Sean - the problem is with your *while* loop condition while t < 6 At this point, *t* is an array of 641 elements because...

9 years ago | 1

Answered
xlsread loop through cell array
Benjamin - if all files are in the same directory, you could do filenames = {'Oxygen_1keV_300K','Oxygen_1keV_300K','Oxygen_1...

9 years ago | 0

Answered
How to convert cell to double array?
Gil - is each element of your cell array a numeric scalar or numeric array? See <https://www.mathworks.com/help/matlab/ref/cell...

9 years ago | 4

| accepted

Answered
Nested loops basic problem, please help
Sophie - there are several ways to solve this problem some of which might involve loops and others that don't. The following is...

9 years ago | 0

Answered
Can't Build Vector in While loop
John - when comparing strings, use <https://www.mathworks.com/help/matlab/ref/strcmpi.html strcmpi> or <https://www.mathworks.co...

9 years ago | 1

| accepted

Answered
How can I make this a double instead of a table?
Adin - try using <https://www.mathworks.com/help/matlab/ref/table2array.html table2array> to convert the table into an array.

9 years ago | 1

Answered
Plotting within for loop
Sudharsan - does this mean that the first 50 elements of u are plotted against t=1:50, the second 50 elements of u are plotted a...

9 years ago | 1

Answered
Grab and reference data from OpeningFcn?
rtbme17 - if you have (for example) variables in your OpeningFcn that you want to reference later, then save them to the *handle...

9 years ago | 0

| accepted

Answered
How to arrange this code in sequence order?
Meenakshi - do you mean that the code does not work? Note that the first four lines are % if a>b we swap the roles of a and...

9 years ago | 0

Answered
Figure identity Question with Loops
Jason - it may depend upon which version of MATLAB that you are using. In (at least) R2014a, the input parameter to *figure* is...

9 years ago | 0

Answered
Hi can anyone tell me what is wrong with my code ? this is my code for data acquisition and i got error
reza - from <https://www.mathworks.com/help/daq/ref/triggertype_session.html?searchHighlight=TriggerType&s_tid=doc_srchtitle Dat...

9 years ago | 0

Answered
How To Add Layers Onto A Map (GUI)
Mark - I think that you have the right idea. Your layer could just be a handle to a graphics object that you show or hide depen...

9 years ago | 0

Answered
How can i delete rows with zeros from a matrix and rebuild the matrix?
Pablo - you could try the following but it assumes that equality with zero will always return true (which isn't necessarily the ...

9 years ago | 0

Answered
How to print size of array?
John - is *xyz* your 3D array? If so, then try fprintf(' size(xyz) at location 123 is [%d %d %d] \n',size(xyz, 1), size(xyz...

9 years ago | 0

Answered
Trying to use xlsread to read a timestamp into MatLab as a string
Dylan - what happens if you read in the data as the <https://www.mathworks.com/help/matlab/ref/xlsread.html#outputarg_raw xlsrea...

9 years ago | 0

| accepted

Answered
How can I divide files into different folders based on the number that the filename ends with?
Sophie - since you want to divide your files into five different folders, then you could consider using <https://www.mathworks.c...

9 years ago | 0

| accepted

Answered
How can i increase the size of * or star in this case ?
sufian - just increase the _MarkerSize_ as plot(P(1), P(2), 'r*', 'MarkerSize', 20) or replace 20 by whatever value makes...

9 years ago | 0

| accepted

Answered
How to read the first line (names variables) of a text file ?
Jeremy - you can try specifying the number of lines to read (using your format specifier) as Names = textscan(fid,' %s %s %s...

9 years ago | 0

| accepted

Answered
Remove NaN from doubles within a cell array
Jonathan - remember that the output of *cellfun* will be a cell array, so the code that you have above will work i.e. using a ce...

9 years ago | 0

Answered
Moving a star marker along a hexagon trajectory?
Zeinab - if you want to traverse the outer hexagon, then you can do something like hStarMarker = plot(NaN, NaN, 'r*'); f...

9 years ago | 1

| accepted

Load more