Answered
Epanet 2.2 toolkit for matlab
It is not possible to create a numeric vector that has 1 column in place but 2 columns when needed. You can do things like hor...

2 years ago | 0

Answered
I have changed to a newer mac and can't get matlab opened. see belos
You need to deactivate MATLAB on the old computer, and activate it on the new computer.

2 years ago | 0

Answered
How do I index an array with varying dimension?
If you use a trailing dimension of : to index, then the result has the proper size but with the dimension "unwrapped" A = ones(...

2 years ago | 0

| accepted

Answered
How do I call a function from the command window
xval = input('enter x: '); myEquation(xval) function myEquation (x) a = 0.4361836; b = 0.1201676; c = 0.93729...

2 years ago | 0

| accepted

Answered
How to use inputs within a function?
a = input('Enter the value of a: '); Discriminant(a); function Discriminant (a) b = a*2 fprintf('The value of b is: %i', b...

2 years ago | 0

| accepted

Answered
Imagesc plot along x-z axis instead of x-y
It is possible to imagesc() in the x-z axis. What you need to do is create an hgtransform object that is parented to the axis, ...

2 years ago | 0

| accepted

Answered
cell2mat not working
If the cell contents are not numeric, then cell2mat() might refuse. In such a case, you can try As_Matrix = cat(1, TheCell{:});...

2 years ago | 0

Answered
explicit vs numerical solution for system of equations
syms r1 r2 theta h %% Define Constraining Values a = 2; b = 5; c = 4; h_c = 5; w_rectangle = h_c + ((b*c)/(a+b)); h_bar_r...

2 years ago | 0

| accepted

Answered
How to ignore special characters and retrieve the data prior to the character
To answer the original question: An alternative way to read the files is to use FixedWidthImportOptions together with readtable...

2 years ago | 0

Answered
writting down the code for the function
y = 4 * sin(x) / (25*x + sin(25)); That is not vectorized. It needs to be y = 4 * sin(x) ./ (25*x + sin(25)); Also remember t...

2 years ago | 0

Answered
Jumps in roots finding solutions
The order of solutions produced by roots() is not documented. If you need a consistent order then use the Symbolic Toolbox, sol...

2 years ago | 1

Answered
Function Call without parentheses
In MATLAB, naming a function with no parameters is equivalent to calling the function with no parameters. This is not the case ...

2 years ago | 0

Answered
Group a function's input arguments into a matrix input argument
matlabFunction(EXPRESSION, 'vars', {[A0,k1,k2,k3,k4,k5], tau})

2 years ago | 1

| accepted

Answered
imshow displays black instead of transparent background of png image
figure hold on plot([1 2], [1 2]) axes("pos",[.1 .1 .1 .1]) [myimage, cmap, alpha] = imread("some_image.png"); foo = imshow...

2 years ago | 0

| accepted

Answered
Unable to use REFPROP material library
That version of refprop is no longer supported https://www.mathworks.com/matlabcentral/answers/1711870-i-am-trying-to-use-matla...

2 years ago | 0

Answered
stop animations with pause()
Create a uicontrol radio button to act as a stop button. TheUIControl.Value = 0; for i=1:10 if TheUIControl.Value == 1 ...

2 years ago | 1

Answered
Why do I get an error when I ran the integral?
f(x) = piecewise(x >= hU & x <= xl, (2 * x) / i^2, x > xl & x <= xh, (2 * x) / (pi * i^2) * acos(((x^2) - hU^2 + x0^2 - i^2)...

2 years ago | 0

Answered
Hello. Im currently creating a code in Matlab and I am running into this error that I will attach in a screenshot. I am new to Matlab so I am having trouble fixing it.
y=conv(x,h,'full')*0.01; The length of a 'full' convolution is longer than than the individual inputs: it is (length(First) + l...

2 years ago | 0

Answered
does matlab have a command similar to Excel's LINEST
The slope is the derivative, so derivative of 6/5*g*h --> 6/5*h which you could easily get using the symbolic toolbox.

2 years ago | 0

Answered
Does this plot look right?
You have a source signal that consists of a single frequency. The theoretical outcome for the fourier transform is all zero ever...

2 years ago | 0

| accepted

Answered
How can I write missing value ncwriteatt
You cannot set the _FillValue of a variable after the variable is created. https://www.mathworks.com/help/matlab/ref/nccreate.h...

2 years ago | 0

Answered
How can I write NaN as missing_values ncwriteatt
You cannot set the _FillValue of a variable after the variable is created. https://www.mathworks.com/help/matlab/ref/nccreate.h...

2 years ago | 0

Answered
separating columns in data files
You only have one column of data -- those are complex numbers. "Only positive" would restrict to just the very first point. Eve...

2 years ago | 0

Answered
help with symbolic int result
syms theta psi No Lo real assumeAlso(theta>0 & theta<2*pi) N1 = (sym(1)/sym(2))*(No/sym(1))*sign(sin(sym(1)*theta +...

2 years ago | 0

| accepted

Answered
Even a simple code I wrote in matlab does not appear in the command window section, only the name of the file appears for example >>untitled1 How can I solve this?
That is normal when code is stored in a file. When lines end in semi-colon, that is a request to not output the result of the l...

2 years ago | 1

Answered
Mean of a cell array
mean(cat(3, TheCellArray{:}),3)

2 years ago | 2

| accepted

Answered
How to solve 'out of memory' problem while solving coupled differential equation ?
You have what is probably a stiff system, but you are using ode45() for it instead of using a stiff solver such as ode15s() You...

2 years ago | 1

Answered
How to create a contour plot from 3 vectors
numcontours = 5; [minx, maxx] = bounds(X); [miny, maxy] = bounds(Y); xv = linspace(minx, maxx); yv = linspace(miny, maxy);...

2 years ago | 0

| accepted

Answered
How to create a contour plot from 3 vectors
numcontours = 5; %https://www.mathworks.com/matlabcentral/fileexchange/38858-contour-plot-for-scattered-data TRI = delaunay(X,...

2 years ago | 0

Answered
different symbols with different colors in a same legend
There isn't any way to do that with legend() You might want to start with https://www.mathworks.com/matlabcentral/fileexchange/...

2 years ago | 0

Load more