Answered
How would I prevent access to classes that shouldn't be publicly available in my toolkit?
The way I'd probably do this is to make the class constructor for the "private" classes have Access='protected' (so only accessi...

4 years ago | 0

Answered
Creating few columns of the Vandermonde matrix without using vander
You could do this pretty easily if you know the powers to which you want to raise the data used to create the Vandermonde matrix...

4 years ago | 0

Answered
Histogram plot by equal time intervals
Rather than specifying the number of bins you could specify the bin edges explicitly. minutesPerDay = minutes(days(1)); T = da...

4 years ago | 0

Answered
Add NaN values in a timetable based on missing datetimes
Here's some sample data. MeasurementTime = datetime({'2015-12-18 08:03:05'; ... '2015-12-18 10:03:...

4 years ago | 0

| accepted

Answered
Too many inputs to CFIT/SUBSREF.error when using a for loop
As long as there is a variable named fit it takes precedence over the function named fit, preventing you from calling the functi...

4 years ago | 0

Answered
Access variables in parallel computing
The functionality in MATLAB to perform background processing may be of use to you.

4 years ago | 0

Answered
Changing the variable used in a loop
Can you iterate over numbered variables like tube_L1, tube_L2, tube_L3, etc? Yes. Should you do this? The general consensus is ...

4 years ago | 0

Answered
divide text into smaller blocks text by . or enter
S = "Today is a good day. Mom cooks breakfast for us." + newline + ... "But I find out only my sister is served." T = split(S,...

4 years ago | 0

| accepted

Answered
How can i write infinite symble in matlab using keyboard shortcut
It depends. What's the context in which you want to use this symbol? If you want to use it as the name of a variable in your co...

4 years ago | 0

Answered
randsample not working in matlab 2022a release , is there any alternative?
The randsample function is part of Statistics and Machine Learning Toolbox. Check the output of the ver function to determine if...

4 years ago | 1

| accepted

Answered
How to extract an element from a ''vector'' of function handle
If you've already created your f function you could do this using one helper function. I vectorized your f function. f = @(x1,x...

4 years ago | 0

| accepted

Answered
Append apostrophe as a text in a function for a searching tool
Instead of calling mat2str repeatedly I'd use the + operator for string arrays to build up the filename. x = 1; y = 2; z = 3;...

4 years ago | 0

Answered
Anonymous function arguments and parameters extrction
As written, as long as you know how long either one of the inputs was, yes. P = @(x, y) [x, y]; x1 = 1:5; y1 = 6:10; z = P(x...

4 years ago | 0

Answered
finding the determinant of a non function without using built-in functions
Your function does not satisfy your stated requirements. All of input, size, ne (the function form of the ~= operator), and disp...

4 years ago | 0

Answered
Unable to resolve the name simulink.compiler.genapp('modelName')
Check the output of ver to determine if you have Simulink Compiler installed. This is the product that contains the simulink.com...

4 years ago | 0

| accepted

Answered
I can't run the software because my username doesn't match the username in the license file. How can I solve this problem?
See if any of the scenarios listed in this Answer apply to your situation and apply the suggestion for that scenario if it does....

4 years ago | 0

Answered
Histogram function plots different colours from those requested
The histogram object has a FaceAlpha property, so that if you overlay two histogram objects you can see the one underneath. If y...

4 years ago | 0

| accepted

Answered
Is it possible to update the text inside other scripts/functions using a separate script?
While you can store the revision history for a file in the file itself, if you're going to build a lot of tools for others to us...

4 years ago | 0

Answered
Why does MatLab subbornly enforces an accessible A4 format width of 17.197916666666664 cm (not 21 cm)???
What is the value of the figure's PaperPosition property? The purpose of that property is to specify the "Figure size and locati...

4 years ago | 0

Answered
How do I use something like 'inputname' to give back name of struct and fieldname supplied?
No. Even if it could, that could be misleading. foo = struct('x', 1); foo(2).x = 3; fun1680729(foo.x, 4) function fun1680729...

4 years ago | 1

| accepted

Answered
Problem using Integral2 for functions only depending on one variable
You can tell matlabFunction exactly what variables the generated function should accept as input arguments. syms x y ansatzf =...

4 years ago | 0

| accepted

Answered
show private and protected methods names of a matlab class
Use the metadata tools provided by MATLAB.

4 years ago | 0

| accepted

Answered
I need to find a way to plug in unknown values into a function I curve-fitted to known data.
You can generate code or export the fit to the workspace. Once you've done that you can evaluate it or perform other postprocess...

4 years ago | 0

Answered
run unit tests in subfolder containing the test files
Try building a test suite using matlab.unittest.TestSuite.fromFolder and then run that suite by calling run on it.

4 years ago | 0

Answered
Why i get problems with index arrays although it seems to have correct Input?
What's the length of your 3-by-13 matrix? A = ones(3, 13); numRows = length(A) % ? This is the correct answer, but not what yo...

4 years ago | 0

| accepted

Answered
Dealing with strings and numbers in a for loop.
Having variables with numbered names like this is a code smell. See this Answers post for an explanation of why they smell and a...

4 years ago | 0

| accepted

Answered
How to Make Sure Command Window Printing Row Vector Without Columns Name in the Whole Screen Not Just Half Screen
Open the Preferences window. In the MATLAB section of the tree, open Command Window. In the Display section of the Command Windo...

4 years ago | 0

| accepted

Answered
Do we have a standard procedure to convert SIMULINK model to HDL code?
Do you have HDL Coder licensed and installed? If so see the documentation and the examples link on that documentation page.

4 years ago | 0

Answered
matlab2021a Computer Configuration Requirements.
See the System Requirements page, which is accessible from the Support section of this site.

4 years ago | 0

| accepted

Answered
Linear System Solve in MATLAB
If you're trying to some the same linear system repeatedly for different right hand side vectors consider using decomposition on...

4 years ago | 2

Load more