Answered
Matlab doesn't release memory when variables are cleared
You can force clear a variable from memory by setting it to empty rather than calling clear on it. x = []; v. clear...

9 years ago | 1

Answered
I have a knn classification model.i want to simulate the same in simulink
You could use the MATLAB function block to call your KNN model from Simulink.

9 years ago | 0

Answered
I need an elegant and fast way to get elements by single index in matrix
>> diag(A(1:numel(I),I)) Or >> A(sub2ind(size(A),(1:numel(I))',I))

9 years ago | 1

| accepted

Answered
how can i create a pdf report with both portrait and landscape orientation?
Try this: import mlreportgen.dom.* rpt = Document('output','docx'); append(rpt, Heading1('Hello')); cl...

9 years ago | 0

Answered
Parallel processing is not able to use all my cores.
You'll need MATLAB Distributed computing server in order to take advantage of all of the cores since they are controlled by sepa...

9 years ago | 0

Answered
Why is app designer not opening?
cd(prefdir) load('matlabprefs.mat') What are the settings in Preferences.appdesigner They should look something l...

9 years ago | 1

Answered
Merging two arrays's
cellfun(@horzcat,A,B,'UniformOutput',false) If you want to ensure uniqueness, wrap a unique around the horzcat cellfun...

9 years ago | 0

| accepted

Answered
Match data by date
This is the _exact_ purpose to |timetable| in R2016b. You'll build two timetables, and <https://www.mathworks.com/help/releases...

9 years ago | 0

| accepted

Answered
How to pass structure data into parfor loop
Use a cell array instead of a structure - they can be easily sliced by index. Or, less preferably, in newer releases turn the s...

9 years ago | 0

Answered
How to change the color of individual bars in a bar chart?
Why not just make a second bar? y = rand(1,3); hb = bar(y); hold on hbr = bar(2,y(2),'r');

9 years ago | 2

Answered
Improving performance of X = A \ B.
Rather than calling \, you can call |bicg| and |gmres| on sparse gpuArrays.

9 years ago | 0

Answered
What existing function can be used to divide two columns of a matrix by each other?
x./y ? In R2016b, this will implicitly expand to work on matrices with compatible sizes <http://blogs.mathworks.com/l...

9 years ago | 0

Answered
Font settings in LIVE SCRIPT?
ctrl + + ctrl + - On a MAC it might be CMD.

9 years ago | 0

| accepted

Answered
More symbolic solver issues
>>syms x >>solve(((5*x + 13)*((25*x)/6 + 47/6) - 30)/((25*x)/6 + 47/6)>0,'IgnoreAnalyticConstraints',true) ans = (3...

9 years ago | 1

Answered
add a new tab to the GUI
Not as of 16b. You can add things to your Quick Access Toolbar but that is it.

9 years ago | 0

Answered
Insert image in AppDesigner GUI
This capability is in R2016b.

9 years ago | 1

Answered
How to replace string but not function
This can be done elegantly and safely with Symbolic Math Toolbox syms x f n model(ix) expr = sinh(x).*f.*n subs(expr,n,mo...

9 years ago | 0

| accepted

Answered
How to speed up manipulations of plot with a lot of data
Have you tried <https://www.mathworks.com/matlabcentral/fileexchange/40790 plot (big)>?

9 years ago | 0

| accepted

Answered
webread.m -- Too many input arguments
What you have for |webread| works fine for me in R2016b, Win7x64. My guess is you're shadowing one of the functions that webr...

9 years ago | 0

Answered
How to reach older versions help pages?
On the right hand side of the documentation home page there's an "Other Releases" hyperlink: <http://www.mathworks.com/help/i...

9 years ago | 2

| accepted

Answered
Matlab language to C
Don't convert Rs to a char! Rs is a double here: Rs=x-(x^2-s)/(2*x); Here you convert it to a char. Rs='erre...

9 years ago | 0

| accepted

Answered
Can you load .mat files from c++ without owning Matlab?
You could have your colleagues use MATLAB Compiler SDK to build you a C++ shared library that could open the MAT files.

9 years ago | 1

Answered
unsupported MATLAB function call for matlab function 'datastore'
If you're generating a mex file then flag it as |coder.extrinsic| and that piece will continue to run in MATLAB. Otherwise, rew...

9 years ago | 0

Answered
Write a constraint for linprog that allows a solution to be either zero or non-zero with a minimum size?
Could you use |intlinprog| with a binary variable to determine 0 or nonzero and then the additional constraints on the minimum s...

9 years ago | 0

Solved


Back to basics 11 - Max Integer
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

9 years ago

Solved


Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

9 years ago

Solved


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

9 years ago

Answered
How to use something similar as the VLOOKUP but in Matlab
[mv,idx] = min(Value) mintime = Time(idx)

9 years ago | 1

| accepted

Answered
How to open a file browser in a MATLAB script?
doc uigetfile doc fullfile

9 years ago | 1

| accepted

Load more