Answered
Adding zeros to a column vector to match a larger column vector
If you're using release R2023b or later, you could use the paddata function. Let's create some sample data: % I have x where th...

2 years ago | 0

Answered
Creating a VAT Calculator in MATLAB
Is there a specific reason you're trying to create the app as a script file yourself? I'd consider using App Designer. If you ha...

2 years ago | 0

Answered
For loop problem for matrix
There are two values which are changing VGPL_xi and values that depend on K and VGPL_xi. Ah. So you're trying to figure out how...

2 years ago | 0

Answered
How to add zeros to the end of an array
If you're using release R2023b or later, you could use paddata or resize to do this. A=[ 1 5 3 8 9 4 7 6 5 2 ]; B=[ 5 2 3 9 7 ...

2 years ago | 0

Answered
Why am I getting a red message when trying to run this code.
In the future, please don't post a picture of your code, post your code itself (formatted using the first button of the Code sec...

2 years ago | 0

Answered
Issue with delete(obj)
Rather than creating and deleting a scatter plot over and over again, I think either using the comet function (if you have all t...

2 years ago | 0

Answered
Direct calculations on tables - elementwise mean of n-tables
Is there a simpler way? Yes. If you know that your data cell array is not empty, just use a for loop. n = numel(data); if n >...

2 years ago | 0

Answered
MCC/deploytool and excluded class
From the documentation "MATLAB Runtime only works on MATLAB code that was encrypted when the deployable archive was built. Any f...

2 years ago | 0

| accepted

Answered
Matlab on two computers, one at work and one in laptop
It depends on the terms of your license. Check with your license adminstrator (if you're using your company's or educational ins...

2 years ago | 0

Answered
Hi When I run my code I got an error message "Invalid expression. Check for missing or extra characters" for my if loop. I am not sure why. Someone there can help me?
u1 = @(x, y, t) 0 u2 ... = @(x, y, t) 0 % u3 % = @(x, y, t) 0 Don't split the code among multiple lines (as u1), or if you...

2 years ago | 0

Answered
Why is dot (".") not considered an operator?
This documentation page lists it in the "Special Characters" section. [To be fair it also lists the colon operator in that table...

2 years ago | 1

Answered
Question regarding the calling of cfit coefficients
The way you gave, asking for the a, b, and c properties of the cfit object named fitobject, is one way to get the coefficients. ...

2 years ago | 0

| accepted

Answered
Insert zeros in random positions following another zero
You can use repelem to replicate the elements. X = [2 1 0 4 5 0 778 90 0 3 88 0 77 66 0 12 23 0 45 80 0 89 67 0 34 67 0 76 32 0...

2 years ago | 0

| accepted

Answered
Find function misbehaves when Indexing into array
%{ if isempty(FindIndex) FindIndex = 125; end %} Rather than assuming that your x array (and your y array) has exactly ...

2 years ago | 1

Answered
Webinar link not emailed after registration
If you've checked that your spam filter didn't trap the emails from MathWorks, please contact Customer Service directly using th...

2 years ago | 0

| accepted

Answered
Outerjoin: resulting table has repeated rows and has erased some data
Rather than storing your data as tables with one variable containing serial date numbers, consider converting those serial date ...

2 years ago | 0

Answered
Using output of the fit function in further calculations
If all you want to do is evaluate the surface fit there's no need to break it into its components parts and re-assemble it. I'll...

2 years ago | 0

| accepted

Answered
Locally suppress Code Analyzer warnings?
See the "Adjust Code Analyzer Message Indicators and Messages" section on this documentation page.

2 years ago | 0

Answered
How to make only x-axis invisible (y-axis stays visible)?
This wasn't an option when the question was originally asked, but now you can change the Visible property of the appropriate rul...

2 years ago | 0

Answered
Renaming output files so as not to overwrite when name is duplicated
There is a function named matlab.lang.makeUniqueStrings that may be of use.

2 years ago | 0

Answered
How do I use Matlab Compiler SDK to create executable for GUI app
I would try writing and deploying a function that opens the app then waits for the app to close before the function returns. Som...

2 years ago | 0

Answered
How to type sin function with square
While the usual mathematical notation to compute the square of the sine of x is , the MATLAB code to perform that computation is...

2 years ago | 0

Answered
What is the logic in the way plots are handled in Live Scripts?
From the documentation for the subplot function: "subplot(m,n,p) divides the current figure into an m-by-n grid and creates axes...

2 years ago | 1

| accepted

Answered
I'm calculating using the order 3 polynomial interpolation method. But why does an array appear?
When you receive warning and/or error messages please show the full and exact text of those messages (all the text displayed in ...

2 years ago | 0

Answered
Is this possible, " 3D Printing with MATLAB ". If so, How far I could go with it ?
There are some old blog posts where people have discussed creating shapes in MATLAB and converting them into the file format use...

2 years ago | 1

| accepted

Answered
How do I solve an ode and plot a graph of two terms within the ode
eta0 = 8080; lambda = 1.109; gamma = logspace(-3, 3, 100); f = @(t,tau)(-(tau+eta0*gamma)/lambda); f is already a function h...

2 years ago | 1

| accepted

Answered
Why didnt get the same result even when using RNG function?
Suppose you stack a deck of cards in a particular way. You then play a hand of standard five-card draw poker with 3 players. You...

2 years ago | 0

Answered
Pass a plot handle into a function argument
Another way to control what is or is not included in the legend, if you have (through calling plot with an output argument) or c...

2 years ago | 0

Answered
Generating standalone application from app designer
Yes, either as a deployed web app or as a standalone desktop application. See this documentation page for more information.

2 years ago | 0

| accepted

Answered
ode45 not working
Don't use global variables. Parameterize your function instead. The way you've written your funcionMAT file, it is a script fil...

2 years ago | 0

Load more