Answered
fitsread is not supported for GPU code generation
The GPU does not have access to file I/O . For example for fprintf() "This function accepts GPU arrays, but does not run on a...

4 years ago | 0

| accepted

Answered
USB relay not working
relayopen = '\xA0\x01\x01\xA2'; relayclose = '\xA0\x01\x00\xA1'; Ports = serialportlist; JuicePort = Ports(3); s = seria...

4 years ago | 0

Answered
Detect New File in a Directory
For Windows see https://www.mathworks.com/matlabcentral/answers/99277-how-do-i-programmatically-detect-a-change-in-a-directory ...

4 years ago | 0

Answered
How to apply color to histograms?
Pass 'FaceColor', 'flat' to histogram2() to cause the colors to be controlled by the colormap. However, the color choice will...

4 years ago | 0

Answered
Arduino Mega 2560 build error: total size of local objects too large
There might be more than one way this can happen, but one of the ways it can happen is if you have a function that has local var...

4 years ago | 1

| accepted

Answered
Force user to input an specific time format
parts = regexp(INPUT, '^([01]\d|2[0-3]):[0-5]\d$'); if isempty(parts) reject end This assumes that you want 24 hour ...

4 years ago | 0

| accepted

Answered
COLOR CODE IN MULTIPLE PLOT
If you are using a new enough version of MATLAB, see colororder If you are using an older version of MATLAB, you could change t...

4 years ago | 0

| accepted

Answered
Improve the design of figures
TextFontSize=20; LegendFontSize = 18; set(0,'DefaultAxesFontName','Times',... 'DefaultLineLineWidth',1,... 'DefaultL...

4 years ago | 0

| accepted

Answered
Is it possible from time domain convert to ωt (x-axis) ?
has units of cycles per second. has units of seconds (typically). would therefore have units of cycles per second times secon...

4 years ago | 0

Answered
How do I create plot from image
See <https://www.mathworks.com/matlabcentral/fileexchange/?term=tag:%22digitize%22> for a number of contributions designed to ex...

4 years ago | 0

Answered
How to expand a waveform on x-axis?
MATLAB only gives control over major ticks, with it deciding minor ticks automatically. Grid lines are drawn at the minor tick p...

4 years ago | 0

| accepted

Answered
Matrix with fix number of ones
for jj = 1:length(A) for k = 1:A skipping = 0; for i = 1:(Total_Time-10) if skipping > 0 ...

4 years ago | 0

| accepted

Answered
Is it possible to implement optimization algorithms, especially particle swarm, with "dynamic bounds" in MATLAB?
Create your ga() with no upper or lower bound. (Linear or nonlinear bounds might sometimes make sense though.) Then use the opt...

4 years ago | 0

| accepted

Answered
How to "automatically" show an equation, written in the matlab editor, as a text on a plot
Write your "master" equation as a character vector or string instead of as a symbolic expression. Then have the code use str2s...

4 years ago | 0

Answered
How do I get the same bin width for two different data sets using the histfit command?
Amin = min(A(:)); Amax = max(A(:)); Abins = 30; %from histfit() call in original code Abinwidth = (Amax - Amin)/Abins; Bm...

4 years ago | 0

| accepted

Answered
How to show the variable name instead of its value in a plot's text, when using "syms", "text" and "latex" functions
You cannot do that, not without reconstructing the formula syms x a = 0.01 ; y = exp(-a*x); % equation to show inside the plo...

4 years ago | 0

Answered
Sequential Constraint in Optimization algorithm.
For now i went for a round about way to do this by putting a if condition that bypass that calculation if the first constraint i...

4 years ago | 0

| accepted

Answered
matrices converted problem into code
no 'ans4' That would be a problem unless you happened to have defined a function no.m that accepted a character vector paramete...

4 years ago | 0

Answered
Need help on how to make an RPG (Role Playing Game)
Create a WindowKeyPressFcn callback on your figure. Inside the callback look at the information in the event structure to figure...

4 years ago | 0

Answered
Extract functionality from add-on to run program without add-on
The license terms do not permit you to copy toolbox files for use by someone who does not have the toolbox. You should have a l...

4 years ago | 0

Answered
confused on how to code this
Use sin(theta)^2 360 degrees = 2π radians divide by 2π 360/(2π) degrees = 1 radian so x radians = 360/(2π) * x degrees In m...

4 years ago | 1

Answered
Sum of series (symsum) in Simulink
Nothing in the Symbolic Toolbox is supported for code generation, including not for Simulink Rapid Acceleration purposes. You c...

4 years ago | 1

Answered
Code Generation Handle Object Not Defined for All Execution Paths
Variables must be initiallized unconditionally in the flow they are used in, with one exception: If the variable is declared pe...

4 years ago | 0

| accepted

Answered
I have this error Index in position 1 exceeds array bounds.
Every one of your .dat files have text headers on them, but in every case you are using textscan() with %f format and no Headerl...

4 years ago | 0

| accepted

Answered
Filling iteration with NaN when output argument is not assigned a value in execution of function.
Inside the function, initialize xv = nan; Then if you do not assign anything else inside the loop, xv will still have been ass...

4 years ago | 1

| accepted

Answered
Caesar cipher matlab code
cc5('HELLO') cc5('ABCXYZ') function out = cc5(in) TT('A':'Z') = ['F':'Z', 'A':'E']; out = TT(in); end

4 years ago | 0

Answered
Comparing changes in value of input variable to function for every function call
function Equipment_calls(Settings_file,Equipment_list,Equipment_libs) %Comparing the each succesive settings file with the prev...

4 years ago | 0

| accepted

Answered
Can I copy a figure during runing ?
Yes you can copy a figure during execution. functions such as exportgraphics() or savefig() or copyobj() can be called. As us...

4 years ago | 0

| accepted

Answered
Why scatterplot changes when I try to make subplots?
discretize() of double() data returns NaN if the data is outside of the range of the bins specified. Otherwise discretize() ret...

4 years ago | 0

Answered
while importing ARXML file, I am getting below error.
That needs the Autosar Blockset, R2008a or later. arxml.importer

4 years ago | 0

Load more