Answered
generation of random no.
Yes, it is possible that the y vector you showed is the outcome of a random process. You have two states, 0 and sqrt(0.5). Yo...

4 years ago | 0

| accepted

Answered
How to check in which step MATALB code is running?
At some point after 2014, if you happened to have an editor window open to something executed by the code, it became possible to...

4 years ago | 0

Answered
Plotting the convolution of u(t) * dirac(t)
syms tau t sympref('heavisideatorigin', 1); u(t) = heaviside(t); d(t) = dirac(t); y = int(u(t) .* d(t-tau), tau,...

4 years ago | 0

Answered
Can't enter inputs unless using workspace values
You are using input() but the code is not assigning the values to the variables. If you input() and expect the user to enter ...

4 years ago | 0

Answered
Elegant way to batch extract all as single data from Data Pool
Expand = @(c)c{:}; [p, q, r, s, t] = Expand(num2cell(dataPool(1,:))); That is, no built-in way is provided to split nu...

4 years ago | 1

| accepted

Answered
Unable to perform assignment because the size of the left side is 1-by-3 and the size of the right side is 1-by-2.
d_eta = 0.001; N = (eta_max - eta_0)/ d_eta; You use N as a size, so you are assuming that it is an integer. However, 0....

4 years ago | 0

Answered
GpuArrays and Subtracting out the Mean
A - mean(A, 3)

4 years ago | 2

| accepted

Answered
too many output arguments when running app
You have % Drop down opening function: DropDown function SchoolDropDown(app, event) end...

4 years ago | 0

Answered
Make polyfit instead of plot
polynomial_degree = 3; %adjust as appropriate p = polyfit(f, abs(FRF), polynomial_degree); fig = figure(1000+p);p=p+1; s...

4 years ago | 0

Answered
How to fix overlapping tick labels?
Not easily. You would have to remove -273 from the list of xticks, and then draw a line downwards extending from the y axes (mak...

4 years ago | 1

| accepted

Answered
Curve fitter app with custom function
If you are using cftool, then when you get to the place to enter the custom equation, you can just enter A*exp(-(x-mu).^2/(2*si...

4 years ago | 0

| accepted

Answered
How do I get a structure to include all the data that I want?
For example, to read all png files in all subfolders of data_dir, storing the input as a cell array of cell arrays broken up by ...

4 years ago | 0

Answered
How can I get precipitation data only for summer (June~August for 30 years)?
See https://www.mathworks.com/matlabcentral/answers/1793770-extract-all-data-for-the-june-months-over-the-years-from-a-timetable...

4 years ago | 0

| accepted

Answered
How to create a quiver with given code?
x=0:5:20; y=0:10:40; z=0:20:80; [X,Y,Z]=meshgrid(x,y,z); v=[]; for i=1:5 for j=1:5 for k=1:5 v(i,j,k,1)=X(i,j,k)^2+Y(i,j...

4 years ago | 0

| accepted

Answered
Extract all data for the June months over the years from a timetable
tested... pcts = load('preciptimedata.mat'); pct = pcts.preciptimedata; [y,m,d] = ymd(pct.Properties.RowTimes); junepct ...

4 years ago | 0

Answered
How do I integrate LegendreP for specific values of m and n?
n = 7; m = 5; lb = -1/2; ub = 1/2; SelectRow = @(M,row) M(row,:); fun = @(x) SelectRow( legendre(n, x.'), m+1 ); output...

4 years ago | 0

Answered
Error trying to change char value, too many inputs
Consider what happens if you have a non-scalar struct or object reference A.B.C and suppose the class does not implement subsref...

4 years ago | 1

| accepted

Answered
When I used my customize state space to perform navigation,the following errors occurs:
Are you using https://www.mathworks.com/help/nav/ref/nav.statespace-class.html ? The property name is StateBounds, but you co...

4 years ago | 0

Answered
Can't run simulink model
Normal Simulink execution beeps when the model finishes. That *is* the notification: it does not pop up a notice saying "Finishe...

4 years ago | 0

Answered
Using solutions from Symbolic Math Toolbox as fit functions
Use the matlabFunction 'vars' option. Pass it a cell array of symbolic variables arrays. Each entry in the cell array will be bu...

4 years ago | 1

| accepted

Answered
Use simulannealbnd without specifying the Upper andd lower bound
use -inf and +inf for the bounds

4 years ago | 0

Answered
function in a script file
"function" statements can never be inside a flow control statement. Anonymous functions *can* be defined inside flow control....

4 years ago | 0

| accepted

Answered
I don't understand the behavior of discretize
discretize() invokes matlab.internal.math.binpicker() ... which places the bins at "nice" locations, involving multiples of 1...

4 years ago | 0

| accepted

Answered
Plot implicit function with log scale
In order to fimplicit this, you need to have an idea of what the y range is. It turns out that there are two solutions for each ...

4 years ago | 1

Answered
How can I add motor control blockset to my Matlab?
Unfortunately the Motor Control Blockset is not available for purchase for Home license.

4 years ago | 0

Answered
-fmesh- face and edge color different for neg, 0, pos Z values
You can color by z by creating a colormap that divides the range up into segments, and setting the first half to the color for n...

4 years ago | 0

| accepted

Answered
Options for ga() with only integer variables
Suppose you had a surface that had a large bowl, but also had a narrow deeper pit. Any given initial population might happen to ...

4 years ago | 1

Answered
Continuously updating Edit Field in Designer GUI
You can create a timer object that continually gets new values from the base workspace and does whatever is appropriate with the...

4 years ago | 0

Answered
saving in new folder by using saveas
outdir = 'polar plots'; if ~exist(outdir, 'dir'); mkdir(outdir); end rho = [AUC_zeroA_avg AUC_zeroB_avg AUC_zeroC_avg AUC_z...

4 years ago | 0

| accepted

Answered
how to calculate voxel image volume ?
discretize() each coordinate axis separately, getting an index number for each point. Use accumarray() with the combined indices...

4 years ago | 1

Load more