답변 있음
normal distributed numbers around a specific value
See the following: https://www.mathworks.com/help/matlab/ref/randn.html https://www.mathworks.com/help/matlab/math/random-numb...

대략 2년 전 | 0

답변 있음
Read a matrix with symbolic variables
filename = 'matrix.txt'; M = str2sym(split(readlines(filename),','))

대략 2년 전 | 0

| 수락됨

답변 있음
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...

대략 2년 전 | 1

| 수락됨

답변 있음
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...

대략 2년 전 | 0

| 수락됨

답변 있음
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...

대략 2년 전 | 0

| 수락됨

답변 있음
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...

대략 2년 전 | 0

| 수락됨

답변 있음
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...

대략 2년 전 | 0

| 수락됨

답변 있음
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...

대략 2년 전 | 0

| 수락됨

답변 있음
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...

대략 2년 전 | 0

답변 있음
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...

대략 2년 전 | 0

| 수락됨

답변 있음
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...

대략 2년 전 | 0

| 수락됨

답변 있음
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...

대략 2년 전 | 0

답변 있음
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]; ...

대략 2년 전 | 0

답변 있음
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...

대략 2년 전 | 0

답변 있음
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...

대략 2년 전 | 1

답변 있음
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...

대략 2년 전 | 0

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

대략 2년 전 | 0

| 수락됨

답변 있음
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...

대략 2년 전 | 0

답변 있음
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...

대략 2년 전 | 0

| 수락됨

답변 있음
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...

대략 2년 전 | 1

| 수락됨

답변 있음
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...

대략 2년 전 | 0

답변 있음
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 ...

대략 2년 전 | 0

답변 있음
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...

대략 2년 전 | 1

답변 있음
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...

대략 2년 전 | 1

답변 있음
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; ...

대략 2년 전 | 0

| 수락됨

답변 있음
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...

대략 2년 전 | 1

| 수락됨

답변 있음
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...

대략 2년 전 | 0

답변 있음
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)) ...

대략 2년 전 | 0

| 수락됨

답변 있음
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...

대략 2년 전 | 0

답변 있음
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...

대략 2년 전 | 0

더 보기