Answered
How do I plot multiple lines of best fit on a scatter plot?
See inline comments for changes. The most significant change is using refline() to plot the regression lines based on the fits....

6 years ago | 1

| accepted

Answered
Legend does not have the right color every two plots.
"Legend does not have the right color every two plots" That's because you're adding two lines on each iteration of your loop. ...

6 years ago | 1

| accepted

Answered
Problem with feedforwardnet function: not enough input arguments
Going all the way back to Matlab r2015b (the earliest version that provides access to documentation), feedforwardnet has always ...

6 years ago | 0

Answered
Making consecutive 1s and 0s as a seperate element
a = [1 0 0 0 1 1 1 1 0 1]; consecGroups = findgroups(cumsum([true, diff(a)~=0])); b = arrayfun(@(g){a(consecGroups==g)},1:max(...

6 years ago | 0

Answered
Line selection if the temperature difference does not change?
"sometimes when it is 0.01 it show 1 and sometimes 0" This is likely due to round-off error. For example, x = 0.01000001 x ...

6 years ago | 0

| accepted

Answered
How to link functionality of Plot "Linewidth" with Knobvalue in appdesigner Matlab (R2020a)
It looks like you're using a discrete knob which returns a character vector in its 'value' property. Here are some options. 1...

6 years ago | 0

| accepted

Answered
why i am getting the error "Index exceeds the number of array elements (1)" in my code? i am getting the error in line 33.
From you code, p = 0.07; p has 1 value, size (1,1). In the loop below, when j>1 you're getting the indexing error because p...

6 years ago | 0

Answered
How to add custom Yaxis option for UIAxes via Editfield(Numeric) while plotting in matlab appdesigner (Ver 2020a)
ymin = app.YAxisMinValueEditField.Value; ymax = app.YAxisMaxValueEditField.Value; % I'm guessing this handle ylim(app.UIAxe...

6 years ago | 0

| accepted

Answered
how to "convert" user inputted letter and number combination to a row,col position on a plot?
"The user is to input a number..." How is the user providing these inputs? If you're using the input() function, don't. It's ...

6 years ago | 1

Answered
How to plot 2 discrete plots (each of a different colour) with stem ?
h = stem(time,graphs) will return a vector of handles. Then set their color using h(1).Color = 'b'; h(2).Color = 'r'; If ...

6 years ago | 0

Answered
funtion to convert value to string
Alternative solution: use an anonymous function. str = getStars(p) returns a string for the given p-value. stars = {'**','*'...

6 years ago | 1

Answered
How to store value of for loop in a array
"some how it stops after 3 itrations at z = 0.03" That's actually not true. In your script, z contains 4 values and the loop h...

6 years ago | 1

| accepted

Answered
How to close mutiple uifigure using command
Just to add another approach, Set HandleVisibility to on when you create the UIFigures. That way their handles will be visibl...

6 years ago | 4

Answered
How to check user input data using letters
The input() method of acquiring responses from a user is highly unconstrained and difficult to manage (see this example). What ...

6 years ago | 2

Answered
How do I use fill to create continuous error bars?
Having the imped_calc function matters because now we can see the size and shape of the outputs. freq is a 1x21 vector. Z_...

6 years ago | 1

| accepted

Answered
Plotting only the positive radius for a polar graph
"Is there a more efficient way to go about ths?" Yes❕ All of that in the loop can be done with this one line, r(r<0) = 0; ...

6 years ago | 2

| accepted

Answered
How can i convert the text to DNA sequence ?
Use regexprep to replace the matches in key(:,1) with the definitions in key(:,2). Since some DNA codes are special characters ...

6 years ago | 0

| accepted

Answered
Handle of UI component from which a context menu has been opened
Neither the cxMenuSelectionFcn nor the ContextMenuOpeningFcn functions indicate the object that evoked the context menu. Chec...

6 years ago | 1

| accepted

Answered
Custom Datatip with Line Information on Matrix Plot
Loop through the object handles and add the DataTipRows for each object. t = 0:.001:1; f = [10,20,30]; % information ...

6 years ago | 1

| accepted

Answered
3D Scatter with different Z axis vector length
I don't know how you're storing the variables but the demo below should get you started. It loops through values of R and you...

6 years ago | 0

| accepted

Answered
Plotting different colored line based on condition(s)
A line object can only have 1 color. To change the color of values above and below y=0 you have to break up your line into segm...

6 years ago | 0

Discussion


New in R2020b: new way to return height or width of arrays
<</matlabcentral/discussions/uploaded_files/2166/2020b_heightwidth_img.png>> Prior to r2020b the height (number of rows) and ...

6 years ago | 6

Answered
Setting the figure size independent of the legend size
It sounds like you want to expand the axis size which would also require adjusting the figure size. Here's a demo. fig = fi...

6 years ago | 1

| accepted

Answered
Diagonal displacement of matrix into another matrix
Fast & efficient vectorized method m is the input matrix size 2xN where N is divisible by 2. A is the output array containing...

6 years ago | 1

Answered
stacked 3d vertical bar
Combining the 'stacked' and 'detached' styles in a 3D bar plot is thoroughly explained here https://www.mathworks.com/matlabcen...

6 years ago | 0

Answered
Stacked vertical 3d plot sorting
bar3(__) styles and limitations Matlab's bar3(data) produces a n*m grid of 3D bars for n rows and m columns of the input matrix...

6 years ago | 0

| accepted

Answered
how can I store a set of segmented output images saved as individual mat files into a cell array
Set up your file names in an array such as filenames = {'201080.mat', '201081.mat', '201082.mat', '201083.mat'}; % full path i...

6 years ago | 0

Answered
Control chart function help
The second input to controlchart(x,group) is a grouping variable that defines which group each element of x belongs to. It must...

6 years ago | 0

Answered
Find z value out of x and y values from a countour in command window
A surf plot is not a contour plot. That was a little confusing. Thanks for clearing that up. Use the handle to your surface...

6 years ago | 0

Answered
Rescale multiple spheres on the same 3d plot
On the first iteration of the i-loop, n equals 6.9637.... This value is passed to sphere(n) and, as the error message indicates,...

6 years ago | 0

| accepted

Load more