Answered
How to reference previous value in an array without a for loop?
use i=2:size(data,1); data.Var3(i)=interp1(ref_data.x,ref_data.y,data.Var2(i))-interp1(ref_data.x,ref_data.y,data.Var2(i-1...

mer än 2 år ago | 1

| accepted

Answered
how to find the find the different rows in 2 matrices based on 2 conditions?
% I just try my best to catch your idea by looking at your words, my engish % is not so good but I want to help you with this p...

mer än 2 år ago | 0

Answered
How to sort a 3D matrix according to the value of each element?
I think you want make something gif to show how the numbers are sorted? % sort show % show bubbling clc;clear % load('Number...

mer än 2 år ago | 0

Answered
How to display the output as table shown below?
You can use a table to achieve the output Node = reshape(permute(z,[1,3,2]),numel(z)/size(z,2), size(z,2)); Nodenumber = char ...

mer än 2 år ago | 0

Answered
Read in numbers as text from excel
IF in excel, a number with high precision is not stored with text format, it cannot be read by readcell with string format for h...

mer än 2 år ago | 0

Answered
Plotting 4D function
In the finite element analysis, you have the coordinates of nodes and elements for node order. Also, to each node, the attached ...

mer än 2 år ago | 0

| accepted

Answered
High dimension matrix summation: a + b != b + a
It is a problem of machine error. If you have learned numerical analysis lessons, you will notice that big number will 'eat' sma...

mer än 2 år ago | 0

| accepted

Answered
how to process the data in a file and repeat the procedure for different folders?
Here is an example for reading files and changing its content q = 0.1:0.1:2; folder = arrayfun(@(i)['surface\',num2str(q(i)),'...

mer än 2 år ago | 0

| accepted

Answered
About the use of find
Find is not at all faster than logical inices. IF you know how to use logical indices to get elements from matrix. I believe yo...

mer än 2 år ago | 0

Answered
Finding certain numbers in vectors
any(ismember(v1, nmbr)) any(ismember(v2, nmbr)) any(ismember(v3, nmbr)) If true, then the vector has any of these numbers [2 ...

mer än 2 år ago | 0

| accepted

Answered
Hello all! I have some ambiguity with MATLAB. I saved my matrix as A(:,:,1) in workspace. Now I want to access column or some entries of my big matrix on command window.
Do by following code for i=1:4 A(:,:,i)=i*ones(4,4); end B = permute(A,[3,2,1]); B(:,:,2) The result is ans = ...

mer än 2 år ago | 0

| accepted

Answered
Specify nature/type of property
First define the food class Then define meals class Now run meals in the command window, we get empty class meals with two...

mer än 2 år ago | 0

Answered
How to solve hyperbolic function ratio equation
you can solve it with symbolic expression syms z x y eq = y/z - tanh(x)/tanh(x/2); sol = solve(eq, x, 'ReturnConditions',true...

mer än 2 år ago | 0

Answered
Remove contour line from unwanted region
%%Example from other user x = -100:100; y = -100:100; inputData = rand(201); inputData(abs(x)<=10,abs(y)<=10) = nan; contou...

mer än 2 år ago | 0

| accepted

Answered
i want to detecting bubble in the image and measuring the size
Use DCT transformation and with a critical bw value I=double(imread ('image.bmp')); I = -(I-min(I(:)))/(min(I(:))-max(I(:))); ...

mer än 2 år ago | 0

| accepted

Answered
How to make a new table from two different table with common value?
result has the same row number as T1 or T2? result = table(C,'variablenames',{'datetime'}); result.value1 = T1.value(1:(size(r...

mer än 2 år ago | 0

Answered
How to export FEMesh?
The mesh is now the field of model you can get mesh by Mesh = model.Mesh; % nodes are obtained by Nodes = Mesh.Nodes; % d-b...

mer än 2 år ago | 0

| accepted

Answered
In solving ordinary differential equations of elasticity, I got the following hint“Unable to find symbolic solution”.How should I modify the solution
That means matlab can not find symbolic solution for the ode with the given boundary condintions (Given values at two ends). Ta...

mer än 2 år ago | 0

Answered
Strings to variable names
Hi, try following code results{:,'X'} = results{:,'Sigma'}; results(:,'Sigma') = []; results{:,'Y'} = results{:,'LR'}; resul...

mer än 2 år ago | 0

| accepted

Answered
Euler's method
Hi, Use y(i+1)=y(i)+ h*(((sin(2*x(i)))/x(i)^2)-(2*y(i)/x(i))); instead of y(i+1)=y(i)+ h*(((sin(2*x))/x^2)-(2*y/x));

mer än 2 år ago | 0

Submitted


Rotate 3d object by local coordinate axis of two vectors
This function is for rotating an object by two perpendicular vectors. I rotate the x-axis to e1 vector direction and y-axis to e...

mer än 2 år ago | 1 download |

Thumbnail

Answered
Please help me. I really need help with copula.
use corrcoef is ok, returns the matrix of correlation coefficients for A, where the columns of A represent random variables an...

mer än 2 år ago | 0

Answered
how to loop a equation.
Why use symbol? R=8.314; T=[600:50:800]; D=0.27*(1.04/-0.22)*exp((-246)./(R*T)) The D array is good to use D = -1.2149...

mer än 2 år ago | 0

| accepted

Answered
Rotation of Ellipse to a specific vector
By following operator you will get what you want clc;clear blueLine = [-0.4, 0.8, 0]; % direction of blue line xc = 1; yc =...

mer än 2 år ago | 0

| accepted

Answered
Euler's Method
Euler forward? clc;clear odefun = @(x,y) x^(-2) *(sin(2*x)-2*x*y); % I have rewritten the ode function xspan = [1,2]; x0 = x...

mer än 2 år ago | 0

Answered
Graph in tiff format : how to interchange X and Y axis ?
I usually use GetData software. while with matlab, I wrote code for this problem below % Extract data from image clc;clear fi...

mer än 2 år ago | 0

Answered
linear interpolation in 3D space
Using point2segmentDistance function function [distance, nearestPointOnSeg ]= point2segmentDistance(point, segmentPoint1, segme...

mer än 2 år ago | 1

| accepted

Answered
Construct the statement on MATLAB: If a person has more than 10 apples then he will sell 8. But if he has less than 10 apples than he will sell 5 apples
apples_left = 20; % total apples at the beginning while true if(apples_left<5) break; end if(apples_left>10...

mer än 2 år ago | 0

Answered
How do I calculate acceleration when I have instantaneous values of velocity?
Use pddiff function attached here, this is easy to use. t = linspace(0,3*pi,19)'; f = sin(t); % assume this is the velocity [...

mer än 2 år ago | 0

| accepted

Load more