Answered
Read a matrix with symbolic variables
filename = 'matrix.txt'; M = str2sym(split(readlines(filename),','))

21 dagen ago | 0

| accepted

Answered
Obtaining a scalar value from a vector output
% take a look at what enzymeGeneral.m is type enzymeGeneral.m If you want enzymeGeneral to return the F and G it calculates, c...

21 dagen ago | 1

| accepted

Answered
Power function fitting graph: problem with tiledlayout
format long g C1=[5e-3 2e-4 5e-5 1.25e-5]'; C2=[5e-3 2e-4 5e-5 1.25e-5 3e-6]'; l3070=[1703.125 37875 68893.75 69006.25]'; l7...

21 dagen ago | 0

| accepted

Answered
File: myFact.m Line: 11 Column: 1. This statement is not inside any function.
If the first executable line of code (that is, the first line that's not a comment) in an m-file is a function declaration, then...

22 dagen ago | 0

| accepted

Answered
This statement is not inside any function.
If the first executable line of code (that is, the first line that's not a comment) in an m-file is a function declaration, then...

22 dagen ago | 0

| accepted

Answered
How to create for loop for calculating euclidean distance of a matrix?
Something like what follows might be what you're trying to do (I'm assuming config.Calculated.Coordinates is the same as Coordin...

22 dagen ago | 0

| accepted

Answered
Number of counts in matrix
You can use nnz. Example: A = [1 1 2; 2 1 2; 3 1 1] nnz(A == 1) % number of times 1 appears in A nnz(A == 2) % number of tim...

22 dagen ago | 0

| accepted

Answered
Matlab Legend Function dose not work at all
You have a variable called legend in your workspace interfering with you calling the legend function. Run clear legend to cle...

22 dagen ago | 0

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

22 dagen ago | 0

| accepted

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

22 dagen ago | 0

| accepted

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

22 dagen ago | 0

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

22 dagen ago | 0

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

22 dagen ago | 0

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

23 dagen ago | 1

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

23 dagen ago | 0

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

23 dagen ago | 0

| accepted

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

23 dagen ago | 0

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

23 dagen ago | 0

| accepted

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

23 dagen ago | 1

| accepted

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

23 dagen ago | 0

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

23 dagen ago | 0

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

23 dagen ago | 1

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

23 dagen ago | 0

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

23 dagen ago | 0

| accepted

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

23 dagen ago | 1

| accepted

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

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

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

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

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

24 dagen ago | 0

| accepted

Load more