Answered
How to solve 3 nonlinear system of equations?
Try using fsolve()(link)

7 years ago | 0

Answered
Greetings, and warn wishes for the new year. I need help in plotting a graph of a equation defined by 3 variables. two of them are lengths and the third one is the angle. So i want to have the values plotted for all different angles.
You don't need a loop at all : clc; clear all; close all; l = 0.1; % length of connecting rod r= 0.05; % radius of crank arm...

7 years ago | 0

| accepted

Answered
How can I solve PDE with initial value but no boundary condition?
Try using any one of the ode solvers.

7 years ago | 0

| accepted

Answered
how to define a function
Just create a function with an input that changes and the just call it to find the integral. doc function% read it

7 years ago | 0

Answered
How to do addition and deletion of elements in matrix? Explain with examples.
x = 1:10 % a vector containing 10 elements x(11)=11 % add an element at the end x(11)=[] % remove an element Note: In a matr...

7 years ago | 0

Answered
How to rectify this error ?
L = 0.035; hs = 0.0005; hp = 0.0001; rhop = 7800; rhos = 8700 ; b0 = 0.01; x = linspace(0,L,100); ratio = 1; nlambda=11;...

7 years ago | 0

| accepted

Answered
how to concatenate a variable, for to store the multiple values?
You may want to use a cell array.

7 years ago | 0

Answered
specified numbers of random permutation of a vector
Perhaps random indexing like below? vector(randperm(100)) % 100 a specified number

7 years ago | 0

Answered
How to count NaN elements in n dimentional matrix, using counter in loop?
Without loop: A=rand(2,2,2); % a short example with 3D matrix A(2,2,1)=NaN; % just insert nan values to check A(2,2,2)=NaN; ...

7 years ago | 1

Answered
what is wrong with the following code, i get the following massege :Subscripted assignment dimension mismatch. Error in Untitled3 (line 14) y2(i)=purelin(y22);
clc; clear all; a=[1 2 3; 20 21 22] b=[1 2 3; 4 5 6; 7 8 9] w1=[4 1 5;2 5 0;6 7 10] w2=[10 11 12; 30 1 0] b1=[0.4; 0.2; 0....

7 years ago | 0

Answered
compute the mean of matrices with different dimensions
Simple example: A=rand(3,3); B=rand(3,3); C=rand(3,2); C=[C zeros(size(A,2),1)]

7 years ago | 0

Answered
Numeric Integral in terms of y = f(x), when I do not have f(x)
Perhaps try using trapz(), https://www.mathworks.com/help/matlab/ref/trapz.html#bual_zk-5( usage tips) : x = 0:0.1:1 y = [0 ...

7 years ago | 0

Answered
How to avoid unwanted values in for loop
Reason: The first two elements are zero because you assign the values from index three so matlab assigns the first two values as...

7 years ago | 0

| accepted

Answered
For loop over writes output with strcmp
L=cell(1,numel(r)); % before loop (preallocation) L{a}.... inside loop ^^^---just add this rest the same celldisp(L) % after...

7 years ago | 0

| accepted

Answered
how to read txt files in the same folder
Processing sequence of files

7 years ago | 0

Answered
f =a^2 *x^2, if a<5. f=a^2*log(x^2),if a>=5&a<60. f=a^3*sin(x), if a>=60&a<=100. How can i compute integration of f with respect to x with two limits for different values of a?
f =@(a,x) a.^2 .*x.^2.*(a<5)+a.^2.*log(x.^2).*(a>=5&a<60)+a.^3.*sin(x).*( a>=60&a<=100) integral2(f,0,1,0,3) % a limits--^^^ ^...

7 years ago | 1

Answered
Creating a matrix showing the binary units of the numberline from 0 to (2**n)-1
Perhaps? n=3; l=0:2^n-1; c=cell(1,numel(l)); % preallocate for i=1:numel(l) c{i}=randi([0 1],1,n); end % celldisp(c) Fin...

7 years ago | 0

Answered
Xi(0)=init(i,s)
Preallocation(link) Xi=zeros(size(s)); % see if it does what you want

7 years ago | 0

Answered
How to convert a symbolic output to its numerical form ( for vector integration) ?
Simply use double() or vpa() to convert symbolic answer to numerical also have a look at matlabFunction() to convert symbolic o...

7 years ago | 0

Answered
how to replace NaN values with zero?
Might happen that your isnan is somehow a variable maybe try the following: clear all A(isnan(A))=0; %%%% an example A=ra...

7 years ago | 10

| accepted

Answered
Error using ofdm_mod Not enough input arguments.
See https://www.mathworks.com/help/matlab/matlab_prog/calling-functions.html https://www.mathworks.com/help/matlab/ref/funct...

7 years ago | 0

| accepted

Answered
Interpolation with a smooth curve
https://www.mathworks.com/help/matlab/ref/interp1.html#d120e628896 t = [0 0.5 1.0 6.0 7.0 9.0]; y = [0 1.6 2.0 2.0 1.5 0]; y...

7 years ago | 2

| accepted

Answered
Generate and solve differential equation? Please suggest some better way if you know.
As John D'Errico says you may want to use odetovectorfield() and matlabFunction() to convert your symbolic odes to numeric odes....

7 years ago | 0

Answered
Area between two points and a curve
https://www.mathworks.com/matlabcentral/answers/180829-shade-area-between-graphs#answer_169649 - just simply use trapz() to calc...

7 years ago | 0

Answered
Creating logical arrays based on condition
c(a<b)=-1 f=c

7 years ago | 0

| accepted

Answered
i want to store all iteration value in the variable.
Here is an example to avoid overwriting in a loop: c=zeros(1,10); % preallocate for speed and efficiency for i = 1:numel(c) ...

7 years ago | 0

| accepted

Answered
Question on error obtained
Just rename the function name so that you don’t get the error again. which sub_map_ar_3 -all % will show you the existing files...

7 years ago | 0

Answered
i want to substract very large value from small value in matlab?
-6.7843e+130 is just a scientific notation of -6.7843*10^130 ,because the number is really huge matlab shows them as such.

7 years ago | 0

Answered
How can i draw this function ?
Define the variables using syms x y and just plot the function with either of the below functions: doc ezplot % 2D doc ezsurf ...

7 years ago | 0

Answered
How i can plot two graphs in one figure?
See https://www.mathworks.com/help/matlab/ref/hold.html , the command would be hold on % an example plot(1:10) hold on plot(...

7 years ago | 0

| accepted

Load more