Réponse apportée
Read a matrix with symbolic variables
filename = 'matrix.txt'; M = str2sym(split(readlines(filename),','))

environ 2 ans il y a | 0

| A accepté

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

environ 2 ans il y a | 1

| A accepté

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

environ 2 ans il y a | 0

| A accepté

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

environ 2 ans il y a | 0

| A accepté

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

environ 2 ans il y a | 0

| A accepté

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

environ 2 ans il y a | 0

| A accepté

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

environ 2 ans il y a | 0

| A accepté

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

environ 2 ans il y a | 0

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

environ 2 ans il y a | 0

| A accepté

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

environ 2 ans il y a | 0

| A accepté

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

environ 2 ans il y a | 0

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

environ 2 ans il y a | 0

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

environ 2 ans il y a | 0

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

environ 2 ans il y a | 1

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

environ 2 ans il y a | 0

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

environ 2 ans il y a | 0

| A accepté

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

environ 2 ans il y a | 0

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

environ 2 ans il y a | 0

| A accepté

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

environ 2 ans il y a | 1

| A accepté

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

environ 2 ans il y a | 0

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

environ 2 ans il y a | 0

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

environ 2 ans il y a | 1

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

environ 2 ans il y a | 1

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

environ 2 ans il y a | 0

| A accepté

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

environ 2 ans il y a | 1

| A accepté

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

environ 2 ans il y a | 0

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

environ 2 ans il y a | 0

| A accepté

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

environ 2 ans il y a | 0

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

environ 2 ans il y a | 0

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

environ 2 ans il y a | 0

| A accepté

Charger plus