Answered
Can I import classes in an interface class in matlab?
You can |import| inside of the individual methods of a class but not globally for the whole class. classdef x methods ...

8 years ago | 3

Answered
Problem with stacking plots, color on x-axis
I'm not seeing the x-axis in the attached picture. Perhaps you could provide a full runnable example? Either way, this shoul...

8 years ago | 0

Answered
How to get the average for repetitive elements of a matrix?
m = [2 20; 2 30; 2 40; 7 100; 7 110; 7 120; 7 130; 7 140; 15 240; 15 260] [uv,~,idx] = uniqu...

8 years ago | 1

| accepted

Answered
Readtable then save in workspace with a new name based on a variable
Use a cell array that is the size of the number of files and then read into it. files = dir(*.xlsx'); filedata = cell(nu...

8 years ago | 1

| accepted

Answered
How to generate C code of sensorcov()?
If you want to know what happens: edit sensorcov You can also walk through it with a debugger which is what I typically w...

8 years ago | 0

| accepted

Answered
How to format YTickLabel with x10^n on when plotting a figure?
y = rand(10,1)*5000; ax = axes; plot(y) ax.YAxis.Exponent = 3;

8 years ago | 0

| accepted

Answered
Close MATLAB from the keyboard
ctrl+s ctrl+q ?

8 years ago | 1

Answered
Will MATLAB optimize a production schedule with many constraints?
If the problem cannot be framed as a mixed integer problem like Alan suggests, you could model the system using SimEvents and th...

8 years ago | 0

Answered
Rearrange cell content by groups
If you use the table datatype, which I strongly encourage over cells(!), then this is a simple one-liner. You can also specify ...

8 years ago | 2

| accepted

Answered
Convert char to number behaves different in command window and m script file
This also works in the live editor which supports more unicode. The classic editor does not support it and thus truncates the v...

8 years ago | 0

| accepted

Answered
How to use patternsearch to optimize two control vectors of a function; optimizing both variables instead of passing one of them?
patternsearch(@(x)OptimizedRate(x(1),x(2)), [weight0 nRate0], ... Index into one variable that is passed to the objective f...

8 years ago | 1

| accepted

Answered
How can I control the stacking order of objects in appdesigner?
You can control the order of the _'Children'_ of a graphics object directly: fig = uifigure; panel1 = uipanel(fig, 'Backgr...

8 years ago | 3

| accepted

Answered
Undefined function 'bufferm' for input arguments of type 'double'.?
Note that in 17b or newer, you can use |polyshape| and |polybuffer| in base MATLAB: <https://www.mathworks.com/help/releases/...

8 years ago | 1

Answered
How can I make a vector in matlab, like vec(x)?
I wrote a |vec| function in grad school for exactly this use. Here it is, authored almost exactly 7 years ago apparently! at...

8 years ago | 1

Answered
how to boxplot on the same figure?
Your xlimits are only showing one of the box plots. I'd also recommend using yyaxis here or perhaps subplots. X1= [1.2...

8 years ago | 1

Answered
Repeat elements in an array for certain number of cycles
Repmat instead of repelem.

8 years ago | 0

Answered
Find n highest values in each row of a table
17b required for maxk but two lines with sort would also work: [T.Var1, rowfun(@(varargin)maxk([varargin{:}],2,2),T(:,2:end...

8 years ago | 1

| accepted

Answered
Missing data values in a matrix
Create a timetable and look at the retime, fillmissing functions. doc timetable doc retime doc fillmissing

8 years ago | 0

Answered
how to use opencv (in a python function) on a matlab function ?
<https://www.mathworks.com/matlabcentral/fileexchange/47953-computer-vision-system-toolbox-opencv-interface>

8 years ago | 0

Answered
how to implement symbolic matlab function on simulink?
You can do this by putting syms inside of a function called by a MATLAB Function block where the inner function is flagged as ex...

8 years ago | 0

Answered
Plotting geographic data not oriented on a grid
For scattered data which is what the column vectors are, use: scatterm If those data represent a grid but are oriented a...

8 years ago | 0

Answered
Logical statement with variable gates and true/false vectors without using EVAL
How about indexing into the function handles? gate = {@and, @or, @(x,y)x&~y} %'&','|','&~'}; tfvect1 = [0;1;0;1;1]; t...

8 years ago | 0

| accepted

Answered
Generating C code from MATLAB functions
You could use the <https://www.mathworks.com/help/releases/R2017b/dsp/ref/dsp.spectrumestimator-system-object.html |dsp.Spectrum...

8 years ago | 1

Answered
I was working on Matlab R2015a's Classification Learner Toolbox. I successfully imported the file data and export it using Export Model, and i got a structure named trainedClassifier. But while running its showing the following error
trainedClassifier is not in your workspace because you have a |clear all| at the beginning of the script which is clearing it. ...

8 years ago | 1

| accepted

Answered
Testing private functions in classes
I would test it through the front door with a known set of inputs and expected outputs. This is the beautiful thing about class...

8 years ago | 1

Answered
How do I import toolboxes into my library?
Why not upgrade to a newer release that has builtin MathWorks Developed graph theory capabilities? <https://www.mathworks.com...

8 years ago | 0

Answered
Tags in the forum
I was able to just add "not a bug" to this question. They moved tags and products to the right hand side apparently... <</ma...

8 years ago | 1

Answered
How can I read an HTML file into MATLAB and discard the HTML tags?
R2017b introduced this capability with the Text Analytics Toolbox. https://www.mathworks.com/help/textanalytics/ref/extractfile...

8 years ago | 0

Answered
How do I convert a string to a single quotes string?
titleName = "Training data " + N_train ?

8 years ago | 0

Answered
How to rotate points on 3D coordinate systems
<https://www.mathworks.com/help/releases/R2017b/vision/ref/pctransform.html>

8 years ago | 0

| accepted

Load more