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

Answered
How to overlap plots from different scripts?
Look up the documentation for copyobj. Not only is a new figure generated with the code you shared but a very important error...

6 years ago | 0

| accepted

Answered
Different results using mesh and surf
> The problem is the two graphs are different. The surf function seems to have gotten it correct, but the mesh function looks li...

6 years ago | 0

| accepted

Answered
How do I repeat a number based on a criteria?
Try out F = fillmissing(A,method) where method is set to "previous". To apply that to your table, it will look something like,...

6 years ago | 0

Answered
A function to set common properties for all open figures
h = findall(0, '-property', 'TickLabelInterpreter'); set(h, 'TickLabelInterpreter', 'Latex')

6 years ago | 0

| accepted

Answered
How can I add a drop-down menu for a certain column in a UItable in App Designer?
Refer to Matlabs documentation on the uitable's ColumnFormat property which demonstrates how to set up pop-up menus within a col...

6 years ago | 0

| accepted

Answered
How to create a Lambertian (diffuse) sphere
There are probably official definitions and methods for a Lambertian diffuse sphere but here's something that looks like it. ...

6 years ago | 1

| accepted

Answered
how can I fix Warning: Imaginary parts of complex X and/or Y arguments ignored.
Your data contain complex numbers. If this is unexpected, it indicates that there's a problem somewhere along your pipeline a...

6 years ago | 0

Answered
Code for Counting and Lookup
Here's a demo. v is the input vector of 1s and 0s (or Trues and Falses) r is the output vector of row numbers in v that star...

6 years ago | 1

| accepted

Answered
How to display plot and rectangle at the same time?
" I have tried 'hold on' , but that didn't work" My guess is that hold on was applied to the wrong axes. This can happen when ...

6 years ago | 0

| accepted

Load more