Answered
'Combntns' function (Where was every element in the previous matrix ?)
Ruymán, I think I understand what you are looking for, even though I don't know how this relates to your issue with |combntns|. ...

12 years ago | 0

| accepted

Answered
How can I remove parentheses in a symbolic expression and perform the operations for the coefficients?
Zoltán, use the <http://www.mathworks.com/help/symbolic/vpa.html |vpa|> command: syms x2 x1 x4 x3 f = x2/24 - x1/6 + x1*x4...

12 years ago | 0

| accepted

Answered
I'm a using matlab for the first time and my code has 2 errors which I don't know how to remove can you please take a look it is a 14 line code.
Ahmed, two things. In the |ode45| call replace |z(0)| by |z0| (you need all four initial conditions, but possibly just a typo) ...

12 years ago | 0

| accepted

Answered
how to define a variable used one time in function
ALAA, you can define |x| to be a <http://www.mathworks.com/help/matlab/ref/global.html global> variable. Alternatively, you coul...

12 years ago | 0

Answered
matlab question response question
John, you just need to build the signal (no need for plotting), e.g., dt = 0.1; % adjust as necessary t = ...

12 years ago | 0

| accepted

Answered
ode45 function error: function must return a coloumn vector. how can i run this?
Tugce, either add xdot = zeros(2,1); right before you start assigning values to the two |xdot| components, or, rewrite t...

12 years ago | 0

Answered
apply if else condition on 3d array
Christoph, use C = bsxfun(@times,B,A==0)

12 years ago | 0

Answered
How to hold a peak value from a fcn block
Richard, use the |minmax| block (also allows you to reset). E.g., <</matlabcentral/answers/uploaded_files/9523/Unbenannt.PNG>...

12 years ago | 0

Answered
Euclidean distance explanation for a matrix
Damit, computing the |pdist| of an |m-by-n| ( |4-by-4| in your case) matrix means computing the pairwise distance between each o...

12 years ago | 0

| accepted

Answered
Double to cell from workspace?
Sandy, use <http://www.mathworks.com/help/matlab/ref/mat2cell.html |mat2cell|>, or, simply, curly braces: A = [1 2 3; 4 5 6]...

12 years ago | 1

Answered
summation operation in matlab
Joe, use syms A ii N = 6; Pb = A^N/factorial(N)/(symsum(A^ii/factorial(ii),0,N)); % symbolic expression sPb = subs(...

12 years ago | 0

Answered
How do I write a combined cell array/struct to excel in a loop, moving one column over for each iteration?
Beverly, use |strcat| to modify the cell name you need to write to: C(1).D = 'b'; % some random dat...

12 years ago | 0

| accepted

Answered
while running this code i am unable to get y (1) ,y(2) and y(3)values.y(1) is coming similar to value of indepent variable and y(2),y(3) is coming 1 &0 resp.Plz. guide where am i getting wrong. thnx
Nita, your code is good, the output from MATLAB is correct. Looking at your DE dydt(1) = y(2); dydt(2) = y(3); dydt...

12 years ago | 0

| accepted

Answered
how to concatenate the two variables.?
Sandy, you could do: a = {'ch1_01' 'ch1_02' 'ch2_01' 'ch2_02' 'ch3_01'}; b = [12.2172 83.1253 32.3429 73.2126 43.3222...

12 years ago | 0

| accepted

Answered
related to image processing
Aman, use out1(i) = str2num(z(1)); instead (and similar for the other |out1(i)| command. |dec2bin| outputs a string, whic...

12 years ago | 0

| accepted

Answered
define depth axis time axis for quiver matlab, depth wise current vectors time series,
Phanindra, use a <http://www.mathworks.com/help/matlab/ref/quiver.html |quiver|> plot: t = 0:10; d = 0:10; [T,D]...

12 years ago | 0

| accepted

Answered
How can I convert a matrix into a number?
Use matstr = strrep(num2str(matrix),' ','') bin2dec(matstr) ans = 107

12 years ago | 0

| accepted

Answered
How can we join two matrices of two dimmention
Abdulkareem, simply use C = [A; B]; where |A| and |B| are your 476-by-11 matrices. A = [1 2 3; 4 5 6]; B = [9 8 7; ...

12 years ago | 1

| accepted

Answered
How to solve this symbolic nonlinear equation
Amit, how about syms F0; temp1 = 0.000015703323139706438927296317410964*F0^2; double(solve(temp1==1,F0))

12 years ago | 0

| accepted

Answered
How to disable all figures that are invoked from within a matlab function?
Saikiran, use set(gcf,'Visible','off'); set(0,'DefaultFigureVisible','off'); for the current ( |gcf| ) an...

12 years ago | 2

Answered
How can I remove the power of a matrix?
Jaybee, execute, e.g. format longeng in the command window. Or use any <http://www.mathworks.com/help/matlab/ref/format.h...

12 years ago | 0

Answered
How to calculate a max value in a array without the built in functions.
Giuseppe, a |for|-loop would be the way to go: maxval = Time(1); for ii = 1:length(Time) if Time(ii) > maxval ...

12 years ago | 7

| accepted

Answered
how to apply if else condition within for loop having cell(each cell containing 4 element) of matrix in matlab.
Biswajit, does this help? C = {[1 2 3 4], [11 22], [1 2], [11 22 33 44]}; for ii = 1:numel(C) % loop through all ...

12 years ago | 0

Answered
how can I convert one square wave to impulses ?
Onur, you could simply take the derivative of the signal, provided that it is somewhat well behaved. See example below: t ...

12 years ago | 0

| accepted

Answered
How do I create a while loop with this percent error function that will work?
Cameron, there are a couple of thing: function outdata = my_series(xlim, dx, err) x = xlim(1):dx:xlim(2); outdat...

12 years ago | 1

Answered
How to add direction line into the phase plane plot?
Alex, use <http://www.mathworks.com/help/matlab/ref/quiver.html |quiver|>. In quiver(x,y,u,v) the |x|, |y| are the grid p...

12 years ago | 0

| accepted

Answered
Subscript indices must either be real positive integers or logicals.
BITS, in function F = myfun(x,param) e11(1,i) = param(1); you don't have a value assigned to |i|. Briefly scanning thr...

12 years ago | 0

| accepted

Answered
How to store values from a function file into an array?
Phoebe, just use M(i) = sum(A.*A1) / sum(A); in function |xtMean| to store values into array |M|. The question is, wh...

12 years ago | 0

| accepted

Answered
Difficulty in calling values from main program to fsolve function
BITS, you need to pass the parameters ( |aa|, etc.) to the function: function my_main() aa = 10; ab = 12; ac = 18; p...

12 years ago | 0

| accepted

Answered
Heaviside and dirac functions in MATLAB 2014 (unbundled student version aka w/t simulink)
Valentina, MATLAB Student (unbundled) includes MATLAB only, no other toolboxes. Both |heaviside| and |dirac| are included in the...

12 years ago | 0

Load more