Answered
How to write if else program on matlab?
elseif (0<power<=1000) This doesn't do what you think it does. If you're writing this code in the MATLAB Editor and you're usin...

6 years ago | 1

Answered
Creating Caps to close a tubular structure
It sounds like you want isocaps. See this documentation page for more information.

6 years ago | 0

Answered
Graph plotting HELP NEEDED
If you're trying to create a plot that has a particular appearance but you're not sure which function can create such a plot, op...

6 years ago | 0

Answered
isempty: Not enough input arguments.
The problem is not that the field z of x.y is empty. The problem is that the field y of x is. In the example below, due to the b...

6 years ago | 1

| accepted

Answered
converting sym to double
Make K a sym array from the start. Then MATLAB doesn't need to convert the symbolic expression 0.7499*k when assigning into an e...

6 years ago | 1

Answered
Naming a struct with a variable?
2 isn't a valid struct array field name. But you can do something like your second alternative using dynamic field names. S = s...

6 years ago | 1

| accepted

Answered
How to add a colormap manually as x-axis under an histogram?
Call colorbar with the 'southoutside' location as shown in the "Add Horizontal Colorbar to Graph" example on the documentation p...

6 years ago | 0

| accepted

Answered
Debug /pause at every function definition line (local function or function script) without explicit breakpoints
There's no way to say "stop whenever a new function gets called" in debug mode without setting breakpoints. But if you're debug...

6 years ago | 0

| accepted

Answered
How can I do this in MATLAB?
Put the cursor on the function whose definition you want to open. Right-click and select "Open <name of function>". There's a ke...

6 years ago | 1

| accepted

Answered
Getting rid of goto()-messes due to inconsistencies
Your mindmap has your problem broken up into small chunks. That's the first step towards modularizing your code. As you correctl...

6 years ago | 0

| accepted

Answered
Solving system of differential equations using ode45
It is, but instead of substituting values for your parameters inline you might want to define a few helper variables at the star...

6 years ago | 1

Answered
My error is the ever popular ::::Error using fprintf Invalid file identifier. Use fopen to generate a valid file identifier. Error in pro1 (line 7) fprintf(fileID,'edges\t initial_nodes\t nodes_after_reduction\t difference \n')
You never check that fopen was able to successfully open the file for writing before you try writing to it. Call fopen with two ...

6 years ago | 0

Answered
Problem with function handle on Root Bracketing
for i = 1 : length(x)-1 if (f(i)*f(i+1)) < 0 Do you want to evaluate your function with the loop index as input or do yo...

6 years ago | 0

| accepted

Answered
Warning: Single line Edit Controls can not have multi-line text
Change the Min and/or Max properties of your edit boxes so the difference between those two property values (Max - Min) is stric...

6 years ago | 0

| accepted

Answered
How to merge datetime and duration in two different columns?
You told MATLAB you wanted to use the format 'dd/MM/yyyy' to display d1. Adding a duration to a datetime doesn't change the Form...

6 years ago | 0

| accepted

Answered
How to get last numerical value from column A only?
When you index into an array with just one index, you're using a technique called linear indexing. This basically treats your ar...

6 years ago | 0

Answered
dataset_Arrays included in matlab2009b?
dataset arrays were introduced in Statistics and Machine Learning Toolbox in release R2007a (when it was called Statistics Toolb...

6 years ago | 0

Answered
Taking a number out of a vector and not replacing it
Use randperm to generate a list of indices you can use to shuffle your list of data. Pull the first three elements from the outp...

6 years ago | 0

Answered
How to move the position of histogram x-axis information
Specify a vector of bin edges as the second input in your call to histogram.

6 years ago | 0

Answered
how to download matlab full version instead of just installer
See the post How can I get MATLAB installation files for use on an offline machine?

6 years ago | 0

Answered
set class property only once
It sounds like you want an immutable property as described here or perhaps to have your classes that want to use the data to sto...

6 years ago | 1

Answered
How to run a regression of lognrnd?
It sounds like you want the lognfit function.

6 years ago | 0

Answered
How to solve the error of solving bessel function
You have a typo in your code. You want to call the solve function, not the slove function.

6 years ago | 0

| accepted

Answered
Symbolic calculation and to solve out a variable
Write your last line as an equation and use solve.

6 years ago | 0

Answered
How to plot vertical lines for each data point?
Combine a plot plot (or a line plot) and a stem plot. x = 0:10; y = x.^2; plot(x, y); hold on; stem(x, y, 'Marker', 'none')...

6 years ago | 3

| accepted

Answered
Error with Set function when I am trying to change the Xlabel form a figure (Unable to use a value of type matlab.ui.Figure as an index.)
Rename the variable you've created in your workspace named set. You intended to call the set function included in MATLAB on the...

6 years ago | 2

Answered
Max number iterations for tolerance
Don't call fminsearch with MyFunc as your objective function from inside MyFunc itself. Move the lines where you call optimset a...

6 years ago | 1

Answered
Why did imread() stop working when I changed to 2019a?
Can you show us the class and size of the url variable you're passing into imread? Is it a character vector or a string scalar ...

6 years ago | 0

Answered
How to check if a column of a table exist?
Use the tools from the "Find and Replace" section on this documentation page. startsWith, matches, or contains will probably be ...

6 years ago | 3

Answered
Datetime comparison near full hours
I'm not certain, but from the way you've described your problem storing your time-based data as a timetable and using withtol in...

6 years ago | 0

Load more