Answered
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...

14 dagen ago | 0

Answered
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)) ...

14 dagen ago | 0

| accepted

Answered
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...

14 dagen ago | 0

Answered
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...

14 dagen ago | 0

Answered
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 ...

14 dagen ago | 0

| accepted

Answered
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(...

15 dagen ago | 0

| accepted

Answered
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...

15 dagen ago | 0

Answered
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...

15 dagen ago | 1

| accepted

Answered
'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...

15 dagen ago | 0

| accepted

Answered
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...

15 dagen ago | 0

| accepted

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

16 dagen ago | 1

| accepted

Answered
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...

16 dagen ago | 0

Answered
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....

16 dagen ago | 0

| accepted

Answered
how to separate number
function v = MySecret( y ) str = num2str(factor(y)); str(str == ' ') = []; % remove spaces v = unique(str-'0');

16 dagen ago | 0

| accepted

Answered
Changing uiaxes title color with button press
ax.Title.Color = [0 0 1]; % or whatever color you like

16 dagen ago | 0

| accepted

Answered
Array indices must be positive integers or logical values.
The variable u is not defined in your code, but if it exists in your workspace and is empty, then the line displacement = u(end...

16 dagen ago | 0

Answered
how to fix "Error using plot. Data must be a single input of y-values or one or more pairs of x- and y-values." error.
plot(uv_model,y(1:N-1),uv,y,uv_model2,y(1:N-1),'g','LineWidth',2)

16 dagen ago | 0

Answered
how to fix a "Error using plot Data must be a single input of y-values or one or more pairs of x- and y-values." problem
Try this: plot(uv_model,y(1:N-1),uv,y,'LineWidth',2)

16 dagen ago | 0

| accepted

Answered
how to specify filling properties in gscatter?
You can modify the required markers after calling gscatter. Here's an example: % random data for 6 groups N = 100; Ngroups = ...

17 dagen ago | 0

| accepted

Answered
Plotting a single contour to divide a region into two
Here's an example: % create vectors for x/y non/oscillatory n = 5; o_idx = [1 2 6 7 8 11 12 16 21 22]; [xo,yo] = meshgrid(1:...

17 dagen ago | 0

| accepted

Answered
Shows error in lung cancer detection using svm
Notice how the error message says "With appropriate code changes". Did you read and follow the documentation for fitcsvm, to ada...

17 dagen ago | 0

Answered
Square wave by vector multiplication
k = (1:n).'; a_k = repmat([1;0;-1;0],n/4,1)*4*A./(k*pi); square_wave = sum(a_k .* cos(k .* 2 * pi * f * t),1);

17 dagen ago | 0

| accepted

Answered
Excluding elements from array
WhennonLinear = find(PositionNonLin==1); Regression = fitlm(StrainA(1:WhennonLinear-1),StressA(1:WhennonLinear-1));

17 dagen ago | 0

| accepted

Answered
Plotting a graph of the distance between the centroid of an irregular shaped particle and its contour (radius) versus angle (equal intervals of theta from zero to 360 degrees)
%Image Threshholding clc; clearvars; clear all; img = imread('1_50.JPG'); %Read image BW = im2bw(img,0.45); %binarize ima...

18 dagen ago | 0

| accepted

Answered
x = 3x3 matrix, x_0 = 3x1 matrix. Need to calculate first 21 vectors in a series using x_n = x*x(n-1)
"some articles said MATLAB indexes at 1 and you can't start at n=0" That's right. Those articles were right about that. "when ...

18 dagen ago | 1

Answered
Post-formatting of figures
You can open the saved figure with the openfig function. f = openfig('figure1.fig'); You can modify any property of the figure...

18 dagen ago | 2

| accepted

Answered
How to unfade legend placed on an empty (invisible) plot?
Instead of making the lines in the last axes invisible, make them all-NaN so they don't show up but the legend stil appears norm...

18 dagen ago | 0

| accepted

Answered
Drawing on UI Axes in MATLAB app designer
Here's a simple demo app you can use to draw. After clicking the Draw button, left-click-and-drag on the axes to draw in black,...

18 dagen ago | 0

| accepted

Answered
Iterating over a cell array: do for loops work?
A few things: A for loop iterates over the columns of what you give it, so if you give it a column vector (cell array or otherw...

18 dagen ago | 0

Answered
Could I get any help with this infinite recursion?
I suspect that the for loop with fprintf is not intended to be part of the function definition. If you move it out (and change n...

19 dagen ago | 1

| accepted

Load more