Answered
why do i get '' Error using / Arguments must be numeric, char, or logical.'' for the line where i have f=
You get this error on the line: f = [(1/k)*300*exp(-(( xj - (L/2)).^2))]'; because you're trying to perform the division 1/k, ...

7 days ago | 0

| accepted

Answered
How to have grayscale and rainbow color plots in subplots?
You can pass in an axes to the colormap function, and you can get the axes from subplot. Just use the gray colormap for the ones...

8 days ago | 0

| accepted

Answered
How to plot this?
You can get an the x and y values for the edges from histcounts2, but that gives you one extra value (you want to tell contour t...

8 days ago | 1

| accepted

Answered
Adding elements from a stuck to an array
This might be easier to answer if you provided some example code, as it's a little difficult to follow your description. The ide...

8 days ago | 0

| accepted

Answered
Determining whether a table's CustomProperties are 'table' or 'variable'
One strategy here would be to use the output of summary, which returns a struct with a CustomProperties field for each Var, and ...

8 days ago | 0

Answered
Struct Field to Matrix large dataset
You can use reshape but you may wish to use permute first to get things in the right order: a=cat(3,[1 2;3 4],[5 6; 7 8]) re...

8 days ago | 0

| accepted

Answered
How to resize a subplot copied to a new figure using CopyObj
This is way easier with tiledlayout and nexttile. With subplot, you can't very easily swap axes: you can use the positions of so...

9 days ago | 0

| accepted

Answered
I want to draw a transparent sphere with three X Y Z and some curves inside it
How about something like this (I'm including the code to draw some circles around the sphere, a couple of different ways, but I'...

9 days ago | 0

Answered
Get listbox into textbox
Here's the modern uifigure/appdesigner style way: u = uifigure; lst = uilistbox(u, 'Multiselect', true, 'Position', [50 50 100...

9 days ago | 0

| accepted

Answered
How to assign multiple variables to variables of a class that is in an array without for-loop.
I'm not sure I recommend it, as it's non trivial to read, but I'm pretty sure in this particular case you can do: [instanceOfMy...

15 days ago | 0

| accepted

Answered
How can I transpose 2 matrices to show 2 experimental conditions?
You need to give MATLAB some information about where these values should go on the x axis. Here's your orignal plot and then a c...

15 days ago | 0

| accepted

Answered
How to get a figure into an axis in app designer?
Normally in MATLAB the hierarchy is Figure - Axes - Chart (plot, bar, scatter, etc.), admittedly the terminology is a little con...

15 days ago | 0

| accepted

Answered
How to expand a table with more columns?
You can use the [ ] syntax to concatenate them, just like with a matrix (make sure that they don't share variable names): a=r...

16 days ago | 0

| accepted

Answered
Change label size of bounding box
You could use the FontSize Name-Value pair on insertObjectAnnotation: I = insertObjectAnnotation(I,'Rectangle',bboxA,labelsA,'F...

16 days ago | 0

| accepted

Answered
Class-Based Unit Tests: Running Specific Methods With Arguments
In your previous question I suggested runtests, but if you look at the other answer @Steven Lord provided a more complex alterna...

16 days ago | 1

| accepted

Answered
I am dividing 8bit binary value to two 4 bits values. How not to get "{}" these bars with my output
The function mat2cell converts to a cell array, which is shown with {} and which you can retrieve the values with the same {} ...

16 days ago | 1

Answered
Renaming y-axis of stackedplot in MATLAB
(I'm not entirely sure why you're using stackedplot if you only have one plot, you might consider just using 'plot' but...) You...

17 days ago | 0

| accepted

Answered
Plotting an average of multiple time series of different length
I think you're saying that you want to resample these all so that they have the same number of samples, then take the average. F...

17 days ago | 1

| accepted

Answered
Class-based Unit Tests: Running Specific Methods
You can use runtests for this: runtests({'foo/test_first','foo/test_second'}) % - or - runtests("foo","ProcedureName",["tes...

17 days ago | 0

| accepted

Answered
if elseif else statement not working
You're writing "x is greater than c and m" and probably thinking of this as "x is greater than c, and x is greater than m". But ...

17 days ago | 1

Answered
For Loop answer into a vector
b = 10; d = 10; E = 207E9; p = -8000; I = (b*d^3)/12; l = 227; x = linspace(1,226,20); % not necessary, but good: y = ...

17 days ago | 1

| accepted

Answered
Please Help, I am getting this error "Index in position 1 is invalid. Array indices must be positive integers or logical values."
If the result of calling rand is small (less than 1/255) then round(rand*255) will be 0, and 0 isn't a valid index. Consider us...

17 days ago | 0

| accepted

Answered
How to use stackedplot on desired UIAxes at App Designer
A stackedplot doesn't go in an axes, it's 'equivalent' to an axes in the sense that it goes in a figure or panel or tab. You cou...

18 days ago | 0

| accepted

Answered
How can I display a list box item as a string in a label in AppDesigner?
Yes this is possible. You can create a listbox, and a label, and assign a callback to the listbox that sets the label. In gener...

18 days ago | 0

| accepted

Answered
discreate heatmap plot over an existing image
The difference here (I'm guessing) is that your overlay has a small number of pixels, but the overlay in the example has a numbe...

18 days ago | 0

| accepted

Answered
How to add different range in x-axis plot?
You can't have a 'broken' x axis, but you can fake it in several ways, here are a couple. One way is to fake the ticks: clf;ho...

18 days ago | 1

Answered
Remove whitespace around exported (saved) figure via imwrite
If/when you upgrade to R2020a+ consider trying exportgraphics(gca, ...) which trims images nice and tight and may be easier than...

18 days ago | 0

| accepted

Answered
How to plot animated graph from a matrix of data?
In some sense, you are going to need to plot each row and capture each frame, as you want each frame of the movie to contain new...

18 days ago | 0

Answered
How to plot three subplots on the same axis?
There are a few options better than subplot. The easiest thing (as @Mathieu NOE mentions in the comments) is to use stackedplo...

20 days ago | 1

| accepted

Answered
Is it possible to colour a scatter3 according to its mean and maximum value
You can color the points in a scatter3 by passing in a vector specifying the value you'd like to map onto color as the 5th argum...

20 days ago | 0

Load more