Answered
store which iterations that the error took place
You could customize your own error message by basing it on the actual error message and appending the iteration number. for i ...

7 years ago | 0

| accepted

Answered
how show weights with different color
See comments h = plot(y,x); % There should be 1 handle per line object % choose the colormap (eg, jet) and number of levels ...

7 years ago | 0

| accepted

Answered
How do I split a sing column .txt file by line?
This solution is quite fast and uses fgetl() to read in blocks of a text file and saves those blocks to a new text file. You ca...

7 years ago | 0

Answered
Customizing location of plot on figure
Here's how to reduce the width of an heatmap to 50% and to center it on the figure. If you only want to reduce it to 50% and no...

7 years ago | 0

| accepted

Answered
Using viscircles to draw circles around points.
Summary of the discussion in the comment section under the question: A matrix was pre allocated incorrectly which led to indexi...

7 years ago | 0

| accepted

Answered
Adding names to each row automatically
If you want to form a matrix at the end, you'll need to keep the variables as numeric where "good" equals 1 and "bad" equals 0. ...

7 years ago | 0

| accepted

Answered
How do I find and replace text in an imported table?
Presumably there's a column in your table for sex|gender and the Male|Female categories are listed in that column. You could us...

7 years ago | 0

| accepted

Answered
Forward, backward and central differences
Assuming the camera is looking down on the fish, since you do not have position 3 (vertical position within the water) you can o...

7 years ago | 1

Answered
Skip certain values in plot and connect adjacent points
How to skip x values. x = 0:pi/10:2*pi; skipPoints = [pi/2, 3*pi/2]; % list points to skip x(ismember(x,skipPoints)) = []; % ...

7 years ago | 3

| accepted

Answered
Change line colour depending on y axis value
Since a line object cannot have multiple colors, you'll need to split the the (x,y) coordinates into 2 groups: within and outsi...

7 years ago | 0

| accepted

Answered
What's the difference between CData and FaceColor in bar()?
Check out descriptions of those two properties here https://www.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.b...

7 years ago | 1

| accepted

Answered
how to use similar push button in a loop for saving numbers from edit box in matlab GUI
When a callback function in invoked, all of the variables within the callback function are created in its own workspace. When t...

7 years ago | 0

| accepted

Answered
Show image in UIAxis with updated axis limits
Check out the "x" and "y" inputs to imagesc(). If you do not supply the x and y values, the axes will represent a pixel count. ...

7 years ago | 0

Answered
How to change size of axis labels in MappingToolbox, as well as ColorBar axis size?
Use setm() to set properties of map axes. setm(axe, 'FontSize', 15)

7 years ago | 0

| accepted

Answered
Is it possible to change the position of graph plot node labels?
I don't think there are documented properties of a GraphPlot that allow you to change the placement of the labels relative to th...

7 years ago | 0

| accepted

Answered
Saving a table as PDF, - how can I rotate it 90 degrees
If the table is saved as a variable, rather than saving a figure that shows the table, save the table itself to a text file. You...

7 years ago | 1

| accepted

Answered
How can Ido the same operations with multiples files using for-loop
A function is designed to have inputs and outputs though neither are required but in general the idea is: ---> [ do s...

7 years ago | 0

| accepted

Answered
How to use Prod function with cell arrays
% Extract the value in index "req_mode" from each cell in "T_mn" % starting and ending at cell index "wire_lay" and "obs_lay" r...

7 years ago | 1

| accepted

Answered
Editing impoly polygons in a GUIDE app
"after this function has executed, I don't see any way to get to that polygon again to detect changes" Once the callback functi...

7 years ago | 0

| accepted

Answered
How to find the position of points given relative distances ?
This solution computes the coordinates of each microphone relative to mic #1 with the following assumptions. The position of...

7 years ago | 0

| accepted

Answered
How can I change the color of each text in a plot?
This line below should work iff the length of 'h' equal 4. set(h,{'Color'},hcolors) % iff length(h) == 4 This line below, ...

7 years ago | 0

| accepted

Answered
Drawing lines from 2 or more separate points to one target point and calculating the distance between them
Use pdist2() to compute the distance between point p and points q. Compute the minimum distance and then plot that line (no nee...

7 years ago | 0

| accepted

Answered
determine combination of elements in matrix
You can use combnk() to create the permuted column indices for each row of your matrix and then replace those values by 0. % ...

7 years ago | 0

| accepted

Answered
Issues with readtable()
" the empty cells in the excel file appear as NaN in table t. How do I prevent this?" NaNs: leave 'em or keep 'em? NaNs are an...

7 years ago | 0

Answered
How would I create a script to read files line-by-line to save memory
Here's a demo that shows how to read in multiple lines of a file in chunks. I included lots of comments that explain what's goi...

7 years ago | 0

| accepted

Answered
Pre-determine plot ranges?
If vector1 and vector1 are the x and y values to be plotted, the xlim and ylim for a tight axis would be, xlim([min(vector1), m...

7 years ago | 0

| accepted

Answered
Matlab - app designer - component name and callback
The 2nd input to a callback function in App Designer is "event'. event.Source is the handle to the object that invoked the call...

7 years ago | 2

Answered
how to enter function into app designer ?
"I want to write the number in a Numeric Field box and to send this number to the UART protocol" From within your app code, the...

7 years ago | 0

Answered
Performing operations on row elements in a matrix
To divide the elements of two row, use " ./ " row1 ./ row2 If you're working with a matrix and want to divide row n by row ...

7 years ago | 0

Answered
How to remove a specific object from cell
Try this out % identify the index of cell array "AllObjects" that contains "obj3" idx = cellfun(@(x)isequal(x,obj3),AllObjects...

7 years ago | 0

| accepted

Load more