Réponse apportée
How to change the C values that matches a 3 coordinates position condition?
Hi, friend! Just use scatteredInterpolant % Here is how I process Ftop = scatteredInterpolant(top(:,1), top(:,2), top(:,3), 'l...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Solving coupled second-order ODEs using ode45 (equations of motion)
The odefun can be obtained using syms command syms M x z Y alpha V_0 l h_0 V = V_0 * ((exp(-alpha * z) - 1)^2 - 1) diff(V, z)...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Add up a certain number of consecutive values followed by the next values in a row
I'll write for you! function a = everynsum(arr, n) p = length(arr); a = sum(reshape(arr,n,p/n)); % in case mod(p,n)=0 end

plus de 4 ans il y a | 0

Réponse apportée
How can I split a file at defined intervals into multiple files?
s = fileread('test.txt'); % read files to string s k = find(s==newline); % find newline position s = mat2cell(s,1, diff([0,k(4...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Can I specify the color of a graphics object by its index in the ColorOrder?
If you want different colors, you can use matlab build-in color series like jet, hsv, bone, copper. Eaxmples are n = 1:6; colo...

plus de 4 ans il y a | 0

Réponse apportée
converting an excel formula into matlab
Hi, friend, I have translated your excel function to matlab command line. clc;clear a = readtable('C-RMSfluctuation.xlsx','Pr...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
how to find out node coordinates for a simple quad element?
Hi, friend! It seems you are studying the finite element method. For fem analysis, two important things for preprocessing are n...

plus de 4 ans il y a | 2

| A accepté

Réponse apportée
How can I create P-code for main script along with their sub-scripts?
You can make main file like this function main() % main file body end function fun1() % fun1 end function fun2() % f...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Translate python into matlab
We firstly make data a matrix. Each row is named grades, and the row number is a. Then python code can be tranlated to matlab on...

plus de 4 ans il y a | 0

Réponse apportée
How I can combine this cell values in a single matrix?
If X{1} is 1x7 array, the simplest way is matrixOut = cell2mat(X')

plus de 4 ans il y a | 0

Réponse apportée
I want to do a 1D integral of some 2D data
trapz function has been wrongly used, trapz(x_array, F(x,y)) is with . So you should do following x=linspace(-3,3,200); y=lins...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Incorporating guess count into a loop
(1) guess higher and guess lower were in the wrong position; (2) the count guessTimes should be initialized outside of the loop...

plus de 4 ans il y a | 0

Réponse apportée
How to put "."after variables in a function for mesh command
Those with matrix times matrix or nth power of a matrix should be used with '.' nc=10; [D,delta_z] = meshgrid(((-1:1/nc:1)*2.5...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How can i match value in file and write the match corresponding row in new file
If, for example, your data can be read by readtable function. File name is 'Data.txt', File format is as following: Col1 ...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
how to solve the one dimension Schrodinger equation?
Search the File Exchange for schrodinger equation,examples are too many

plus de 4 ans il y a | 0

Réponse apportée
Reading .txt with multiple delimiters
If each line in the file is of the same format, I recommend the following formatSpec formatSpec = 'Sensor %d| %d| %f mS...

plus de 4 ans il y a | 0

Réponse apportée
How to plot using a loop on the same axis
Is the time array t the same size as position1,speed1 for each loop with different customers? If so, then following loop will h...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Please Solve error occurring while solving differential equation with ode15s
Just rewrite dxdt = A_cap*[x(1);x(2);x(3);x(4);x(5);x(6)] + R*F; N*[x(7);x(8);x(9);x(10);x(11);x(12)]+L*y + R*F_cap t...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
use string as x and y for a plot
Just use str2double function! NOMAX410LCR_Cp = str2double(NOMAX410LCR_Cp); NOMAX410LCR_Frequenz = str2double(NOMAX410LCR_Frequ...

plus de 4 ans il y a | 0

Réponse apportée
Answer this Newtons Method problem
why not use fsolve or fzero? The following is newton's method function main f = @(x) [ sin(x(1)*x(2)) + x(1) - x(2); ...

plus de 4 ans il y a | 0

Réponse apportée
Preallocating str for speed
According to @dpb's answer, here I provide a more general answer! T='956754674275'; encode = 'ABCDEFGHIJ'; str = encode(doubl...

plus de 4 ans il y a | 0

Réponse apportée
How to find unknown constants from exponential equation
Your code is ok, but the nonlinear model function may not so well selected! clear v = xlsread('Book1.xlsx'); x=v(:,2); t=v(:...

plus de 4 ans il y a | 0

Réponse apportée
Draw circle and ellipse in matrix
in line 3, do not use domain=ones(nx,ny); but use domain=ones(ny,nx);

plus de 4 ans il y a | 0

Question


How can I timely recieve the simulation results via email
I use matlab to simulate something interesting, e.g., finite element analysis, but it takes long time to finish. Each time step ...

plus de 4 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
How to remove all the rows containing a substring from a table?
Assume the table is named 'myTable'. Then p = arrayfun(@(i)strncmpi(myTable.beregnings{i}(end:-1:1),'maertsnwod',10),(1:1:siz...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Replace NaN with median per column
It is convenient to use fillmissing function to get what you want matOut = fillmissing(matrixIn, 'linear', 'EndValues','nearest...

plus de 4 ans il y a | 1

Réponse apportée
How can I extract quickly the numbers separated my commas and parenthesis from a txt file?
It is quite easy to do so. fid = fopen('a.txt','rt'); % a.txt is your file name a = textscan(fid,'(%f, %f) %f'); a = cell2mat...

plus de 4 ans il y a | 0

A résolu


Calculate a Damped Sinusoid
The equation of a damped sinusoid can be written as |y = A.ⅇ^(-λt)*cos(2πft)| where |A|, |λ|, and |f| ...

plus de 4 ans il y a

A résolu


Solve a System of Linear Equations
*Example*: If a system of linear equations in _x&#8321_ and _x&#8322_ is: 2 _x₁_ + _x₂_ = 2 _x₁...

plus de 4 ans il y a

A résolu


Verify Law of Large Numbers
If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

plus de 4 ans il y a

Charger plus