Réponse apportée
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 = ...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 1

Réponse apportée
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...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

Réponse apportée
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...

plus de 4 ans il y a | 5

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

Réponse apportée
Trying to retrieve and display the initial value of an input
I think you just flipped it, if you want to set a equal to the initial value of x0, do a=x0 demo(5,10) function demo(x0,x...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How can I graph an average and individual participant data?
It's a little difficult to visualize what this looks like, but here's what i took away from looking at your code you have a thi...

plus de 4 ans il y a | 0

Réponse apportée
scatter not ploting matrix
Yes this functionality was just recently introduced in R2021a The relevant section from the release notes reads: Scatter Plo...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Why do I receive "Index exceeds the number of array elements (1)" ?
You wrote: For some background, m and t are both defined already in my workplace and they are both vectors. But you redefine...

plus de 4 ans il y a | 0

Réponse apportée
Drawing a line to divide two parts of a curve
You can draw a vertical line very easily with xline area works well for filling a part of the curve x=linspace(-3,3,100); y...

plus de 4 ans il y a | 0

Réponse apportée
51 uniformly-distributed points
You can create uniformly (linearly) distributed values with the linspace function: x = linspace(0, 5, 51) Alternatively, you m...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
array indexing returns empty row vector while attempting to locate index corresponding to only certain array values
This is an issue of floating point arithmetic, another way to state the problem is: (.1+.2)==.3 What? How can those not be equ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Dealing with Data Structures
I think in general it's better if your struct is an array rather than using names of fields in the struct as an array, but if yo...

plus de 4 ans il y a | 0

Réponse apportée
Nested for loop for multipication
I think the question is really how you store your total values (you didn't store them in your snippet, so I'm not sure how you p...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
fill missing point in data (x y z 3 columns data)
You can use meshgrid to make x and y grids, and then ismember with the rows flag to find which pairs of x and y are missing: % ...

plus de 4 ans il y a | 0

Réponse apportée
How to locate the plotting title above the legend, where the legend is placed "northoutside"?
You can put a title on the legend, but I think you just want a master title for everything. You can do that by placing your axes...

plus de 4 ans il y a | 2

| A accepté

Réponse apportée
How to relate data to other data from excel in MatLab?
In general, it's better to think of it not as Height(Name1), but as Height(Species=="Name 1"), this extends to all sorts of data...

plus de 4 ans il y a | 0

Réponse apportée
How do I use output values from a function to plot those values in a script
I think what you're looking for is: [t,~,v] = rocket_euler(30,20) plot(t, v, '.-','color',[0 1 0],'Marker','x','markersize',15...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
select one item between two List Box
How about just using the callback of one to deselect the other: % Set up some example listboxes: u = uifigure; lsta = uilistb...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
graph with two formulas
You can make the error bars with the errorbar function, but your excel file doesn't appear to include data about error... a=r...

plus de 4 ans il y a | 1

Réponse apportée
Call Function from .m file in command
@L McKeehan - perhaps the most common reason for this is that the function is not on MATLAB's search path. When you try to run a...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
What should be the distance between the two cameras?
This isn't a very MATLAB-y answer, but the lenses in stereo cameras typically try to replicate the distance between the eyes (ac...

plus de 4 ans il y a | 0

Réponse apportée
Trying to change columns in a Matrix
Specifying rows and columns makes MATLAB point to rectangles: a(1:2,1:4) refers to rows 1 and 2, columns 1 through 4, i.e. MATLA...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Showing the equation of the best fit lines per graph
Are you struggling with how to get the text? or how to display it on the chart? Here I put them in the legend, and also added...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Get ticks to lay across colorbar
The unit for TickLength is peculiar. If you check out how it's documented on the colorbar page it says: Tick mark length, speci...

plus de 4 ans il y a | 0

| A accepté

Charger plus