Answered
How can I make these few lines a function?
Sure, just toss them in a function and call the function. I might suggest, though, function setup_plots(ax) if nargin < 1...

4 years ago | 1

Answered
I need to show the area of objects found using bwconncomp for successive frames
areaOfObject{k} = [stats.Area]; You have multiple objects per frame, so stats is a nonscalar structure. stats.Area would then b...

4 years ago | 0

| accepted

Answered
High frequency generation ( 100K ) and above using Simulink and deploying it on Arduino
If you are using the USB connector, and if you are transfering each sample individually, not many people manage to get more than...

4 years ago | 1

Answered
How to remove other color line in graph ?
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1092850/image.png'; rgb = imread(filename); mask = ...

4 years ago | 0

| accepted

Answered
Axes of polar plot
%when you use polar() the lines are given hidden handles ax = gca; LL = setdiff(findall(ax, 'Type', 'line'), ax.Children); Yo...

4 years ago | 0

| accepted

Answered
Script not running for different variable size.
The problem is that you stop counting at 10 overlaps. As the time increases, the number of overlaps increases, until you get to ...

4 years ago | 0

Answered
Create matlab code for memory game.
Techniques for filling in the hidden board gorp = repmat('27=@/',1,3) gorp = gorp(randperm(numel(gorp))) gorp = reshape(gorp,...

4 years ago | 0

Answered
Create an image from x and y locations with greyscale value
The following code does not assume that every grid location will have a value given, and also it does not assume that the coordi...

4 years ago | 0

| accepted

Answered
Diary file name in increment to be saved in a separate folder
You can turn off 8.3 filename generation; see https://www.tecklyfe.com/windows-server-tip-disable-8-3-naming-strip-existing-shor...

4 years ago | 0

Answered
odeEvent doesn't terminate the integration process?
The event functions are typically only executed at the end of a step, after the step has succeeded. The event functions are exec...

4 years ago | 0

Answered
Undefined function 'savetofile' for input arguments of type 'sym
Source code is posted at https://www.mathworks.com/matlabcentral/answers/215594-saving-within-spmd-or-parfor

4 years ago | 0

| accepted

Answered
how can i make graph between real(c) and k for diffferent values of h
Replace Dfun=matlabFunction(D); with Dfun = subs(D); in multiple places.

4 years ago | 0

Answered
Error parsing function variables
If you are using https://www.mathworks.com/matlabcentral/fileexchange/65494-non-sorting-genetic-algorithm-ii-nsga-ii (which appe...

4 years ago | 0

| accepted

Answered
I HAVE A KEY WHICH IS 1*16 MATRIX. HOW CAN I DETERMINE IT'S BIT SIZE?
KEY=[0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0] bits_required_per_entry = max( ceil(log2(KEY)) ) However the calculatio...

4 years ago | 0

Answered
How to use coder.unroll in a while loop
coder.unroll() by itself cannot do that. coder,unroll() always unrolls the number of times given in the for loop. The loop limit...

4 years ago | 1

| accepted

Answered
For loop to access fields from structure and save them in an array
town_codes = ["SH", "AM", "SC"]; fields = "PIE_" + town_codes + "_many_shocks_SH"; f_pie_cell = arrayfun( @(field) big_struct....

4 years ago | 0

Answered
How to input a data variable with 2 different values?
S(j) = input ('Área da secção transversal das barras = ');

4 years ago | 0

Answered
How to read specific value from the hdf5 file.
That facility is not available for HDF. You can modify the count to 1 for the third dimension to read in only (:, :, 1). Then...

4 years ago | 0

| accepted

Answered
AUTOSAR A16-0-1: possible contradiction?
I looked at the Rationale in the AutoSar CPP14 Guidelines... and you are right, you can't do that. Since C++17 you can use the ...

4 years ago | 0

| accepted

Answered
"Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 0-by-0."
I predict that your mu is empty. function [dS] = CR3BP(~, s, mu, ~) That function expects 4 parameters. [t_cor, s_cor] = ode4...

4 years ago | 1

| accepted

Answered
Trying to plot an estimate of a surface with plot3
Your A1 and A2 are vectors the same length, but your NS is 2D. Effectively for each A1(J), A2(J) you draw a column NS(:,J), whic...

4 years ago | 1

Answered
How to get the frequency range of the audio signal
I am trying to get the frequency range that the audio signal has, it is a breathing sound Breathing sounds are not even close t...

4 years ago | 1

| accepted

Answered
I have problem "file name'c:\new folder\bin\fuzzy scheduler+1.m is not formed from availed MATLAB identifier.
The names for .m files must start with an English letter (A-Z or a-z). Each character after that must be an English letter, or e...

4 years ago | 1

Answered
How to calculate the area under two peaks?
y goes before x in findpeaks() call. filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1098535/i22-569...

4 years ago | 0

| accepted

Answered
Run a function using gpu inside a parfor loop or a for loop
See https://www.mathworks.com/help/parallel-computing/run-matlab-functions-on-multiple-gpus.html#MultiGPUExample-2 Notice in p...

4 years ago | 0

| accepted

Answered
How to use feval to call a class
feval(name).create

4 years ago | 0

| accepted

Answered
Are there any isempty command block in Simulink?
https://www.mathworks.com/help/simulink/slref/width.html can emit the width of a signal; you could then compare it to 0. ... Or...

4 years ago | 0

| accepted

Answered
How can i store multiple audio files in a variable ?
Unless the files are all the same sampling frequency and the same number of samples and the same number of channels, then I reco...

4 years ago | 0

| accepted

Answered
How to solve 3 non-linear equations with 3 unknowns?
The numeric solutions being produced are dubious. Notice how if we increase the number of digits to process at, that the magnit...

4 years ago | 0

Answered
edit the orbital elements
The original of the file is at filename = fullfile(matlabroot,'examples', 'aero_satcom','data','SatelliteScenarioCustomAttitude...

4 years ago | 0

Load more