Respondida
How can I update plots in a GUI from a background data queue?
"You can see that my callback function for the afterEach command accepts TWO inputs" That's not really true. This anonymous fun...

16 días hace | 0

| aceptada

Respondida
How can I link all the solutions (link between the blue lines)?
One way is to collect all the points to be plotted into two matrices, one for x-coordinates and one for y-coordinates, remove th...

16 días hace | 0

| aceptada

Respondida
Plot two graphs on the same plot in gui and create two axis in the same plot
Do you want two lines in one axes, or one line in each of two axes? If two lines in one axes, it looks like you already have th...

16 días hace | 0

Respondida
Exponentially Weighted Moving Average (EWMA)
Here's how you can perform the calculations you've listed: % given: a = 0.3; x = [0.15 0.11 0.11 0.1 0.09 0.12 0.11 0.09]; ...

16 días hace | 0

Respondida
How to position a geoaxes figure within a uifigure
Default geoaxes Units are normalized (see here), which means that a Position of [100 100 500 500] places the geoaxes' lower left...

16 días hace | 0

Respondida
Plotted patch changes size
"some patches don't reach the top of the plot or the bottom of it ... I set patches according to yLimits ... Any idea what coul...

17 días hace | 1

Respondida
Im trying to create an air hockey game in which both of the blockers are player controlled.
It should be feasible. Refer to the following code for one way you can control two different objects via a single key press func...

17 días hace | 0

Respondida
How can I vectorize my code?
Vectorizing involves using element-wise operations (a.k.a. array operations), e.g., .*, ./, .^, rather than matrix operations, e...

17 días hace | 0

| aceptada

Respondida
Importing a .csv file
Here's one way you can try to fix that file: f_in = 'data.csv'; f_out = 'data_modified.csv'; % show the original file's con...

17 días hace | 0

Respondida
Index exceeds the number of array elements. Index must not exceed 2. ylim
You have a variable called ylim in your workspace which is preventing you from calling the built-in ylim function. Clear it cle...

17 días hace | 0

| aceptada

Respondida
Graphing partial sums of a series
In your expression for S1: S1 = S1 + (2*((1/2*n-1)*(sin((2*n-1)*(x))))-2*((1/2*n)*(sin((2*n)*(x))))); You need parentheses aro...

17 días hace | 1

| aceptada

Respondida
Zoom in on a particular part of the plot with circular view
Some examples of doing that can be found in the following: https://www.mathworks.com/matlabcentral/answers/60376-how-to-make-an...

17 días hace | 0

Respondida
Color bar range color
The easiest way to do that is to use geoscatter, which allows you to specify colors as indices into the colormap. See this line ...

17 días hace | 0

Respondida
How to give call back function in app design using MATLAB.
Since the editfield for number of boxes and the enter button for getting dynamic input boxes are created programmatically, speci...

17 días hace | 1

Respondida
How to color values in corrplot function?
Here's one way: load fisheriris [~,~,h] = corrplot(meas); g = findgroups(species); idx1 = find(g == 1); idx2 = find(g == 2...

17 días hace | 0

Respondida
How to interpolate vector data sets using interp2()
You can't use interp2 with those vectors because they don't define a grid. You can use scatteredInterpolant instead. x = [800; ...

17 días hace | 0

| aceptada

Respondida
I want to calculate the average of cell array matrix
If I understand the question, you can do: B = cellfun(@(x)mean(x,'all'),A,'UniformOutput',false); Example: A = {zeros(5),magi...

17 días hace | 1

| aceptada

Respondida
How can I have a user choose between two functions to run?
Here are a few options: <https://www.mathworks.com/help/matlab/ref/questdlg.html questdlg>, <https://www.mathworks.com/help/matl...

18 días hace | 0

Respondida
Error creating a new type of fit using fittype.
There is an extra open parenthesis at the front (or a close parenthesis is missing at the end): r+(((a*(x^b))/(t^b+x^b)) ...

18 días hace | 0

| aceptada

Respondida
Weird results while coding using an m-file
This is an effect of floating-point arithmetic. Related: https://www.mathworks.com/matlabcentral/answers/57444-why-is-0-3-0-2-0...

18 días hace | 0

Respondida
Update a 3D graph without resetting viewpoint?
Yes. You can store the axes view and later restore it to the stored value after updating the plot. See view. Alternatively, upd...

18 días hace | 0

Respondida
fplot simplemente no responde
Are you running commands in the command window? If so, is this what you see at the bottom of the command window? If so, you ...

18 días hace | 0

| aceptada

Respondida
How to find the difference between non-consecutive values
t1 = datetime(2013,11,1,8,0,0); t2 = datetime(2013,11,5,8,0,0); t = t1:t2 X = 1:5:25 A = diff(X(1:2:end))./seconds(diff(...

18 días hace | 0

| aceptada

Respondida
Trouble finding the closest match in a datetime array given a datetime value.
timePos = load('timePos').timePos; timeForce = load('timeForce').timeForce; The elements of timeForce all represent date/times...

18 días hace | 0

Respondida
How can I make uitable show me acutal values instead of class/type of variable?
I guess RMA{7,1} is the table returned from ranova, in which case you can try: T = RMA{1,7}; T = convertvars(T,1:width(T),'dou...

18 días hace | 1

| aceptada

Respondida
'Plotting the Average Vertical Line
center_col_data = img(:, 178:198); And whether you should plot(center_col_data) or plot(center_col_data.') is not clear to...

18 días hace | 0

| aceptada

Respondida
Ignore Case when Combining Tables
"is there a way to easily change the variables with lowecase letters to all match" Yes. Use the lower function. Here's an examp...

18 días hace | 0

| aceptada

Respondida
vertical alignment of x-axis labels in bar charts
ax = gca(); ax.XAxis.TickLabelRotation = 45; % <- or whatever angle you want

19 días hace | 1

| aceptada

Respondida
How to draw a line in a bar chart in complete x area
cats=categorical({'a','b','c'}) data = [37.6 24.5 14.6]'; errhigh = [2.1 4.4 0.4]; errlow = [4.4 2.4 2.3]; bar(cats,dat...

19 días hace | 0

Respondida
How do you make multiple for loops into one for loop?
No loops required: Rb = cosd(phi)*cosd(delta).*cosd(w)+(sind(phi)*sind(delta)); % row vector the same size as w I = Io....

19 días hace | 0

| aceptada

Cargar más