Answered
Variable for table are in one row and not one column. How do I turn it or save a variable in one column?
number = 3 ; data = [1:number]' t = table(data,'VariableNames',{'Set number'})

6 years ago | 1

Answered
How to plot points from odefun
Note that Y is a m*3 matrix, you need to plot each column seperately. figure(1); plot(T,Y(:,1)) figure(2); plot(T,Y(:,2)) ...

6 years ago | 0

| accepted

Answered
finding data points for a graph using a for loop
txt = readmatrix("ec.txt"); x = txt(:,1) ; y = txt(:,2) ; z = txt(:,3) ; b =70e-9; a =49e-9; epsilon_b=1; s=0.5...

6 years ago | 0

Answered
Smoothing the plots with points
Try fitting a Bezier Curve: I have referred this link: https://in.mathworks.com/matlabcentral/fileexchange/33828-generalised-bez...

6 years ago | 0

Answered
Creating a structure of fields using a "for loop" - some fields (columns) are slightly shorter - which is the issue. NaN values may be added at the bottom of those shorter fields (columns)
a=NaN(100,500); for k=1:500 T = datasource(k).numbers(:,1) ; a(1:length(T),k) = T; end Or the option is you can make...

6 years ago | 0

| accepted

Answered
Error message saying "Matrix dimensions must agree"
"Matrix dimensions must agree". not too sure why this is. The error is pretty simple. You will get this error, when you try to...

6 years ago | 0

Answered
Create matrix with two matrices
A = [1 2 3; 4 5 6;7 8 9] B = [ 11 12 13;14 15 16;17 18 19] m = size(A,1)+size(B,2) ; C = zeros(m,3) ; C(1:2:end,:) = A ; ...

6 years ago | 1

Answered
Plotting the given Trigonometric functions
x = linspace(-pi,+pi); y = x ; [X,Y] = meshgrid(x,y) ; Z = Y.*sin(2*X)-X.*cos(2*Y) ; surf(X,Y,Z) colorbar

6 years ago | 1

Answered
How to to take a value positive of equation
sol = double(x2) ; sol(sign(sol)==1)

6 years ago | 1

| accepted

Answered
Split a data in random partitions
A = rand(100,2) ; n = size(A,1) ; % Get 70% of data random from A m = round(0.7*n) ; % Randomize the data idx = rand...

6 years ago | 1

| accepted

Answered
How to solve an equation
syms x fOut=1/3 m=1 s=1 eqn = fOut -(exp(-0.5*((m-x)/s)^2)/(s*(2*pi)^0.5))== 0 ; s = solve(eqn,x)

6 years ago | 0

| accepted

Answered
extracting the index of an irregular line on a 2D matrix
Read about ismember. A = rand(10) ; B = A(randperm(100,10)) ; [c,ia] = ismember(A(:),B) ; A(c)

6 years ago | 0

Answered
All possible combinations of a number of an array
Use this file exchange: https://in.mathworks.com/matlabcentral/fileexchange/69507-npermutek v = 1:3 ; iwant = npermute(v,3)...

6 years ago | 0

Answered
How to use the method in this article I uploaded to write a program to fit a closed curve?
Attaching an article and uploading your data, you expect us to write a progrma for you? You can have a look on the below toolb...

6 years ago | 0

Answered
MATLAB cannot integrate trigonometry in the form of degree
Note that at the end, your answer will be in degrees....you can convert it to raidians and check. syms x f = cosd(x); % x is ...

6 years ago | 1

Answered
Operands on table, comparison with numbers
You have to access the columns of Table T using T.(1), T.(2) etc, Read about accessing the columns from tatble. If you have na...

6 years ago | 1

Answered
how to plot tangent of y=x^(1/2) at a point x=4 on MATLAB?
It is a MATHS question. You should know the steps of how to follow. Refer it here: https://intl.siyavula.com/read/maths/grade-...

6 years ago | 0

Answered
Extracting certain rows from matrix
Read about ismember.

6 years ago | 0

| accepted

Answered
How to call n numbers from a Matrix
watlevel=[1.8; 1.5; 1.2; 1.3; 1.4; 1.6; 1.7; 1.4; 1.1; 0.9; 0.2; 0.2]; %incoming water level time=[0; 3; 6; 9; 12; 15; 18; 2...

6 years ago | 1

| accepted

Answered
How to know which plot is more linear then the other?
How about finding the area bounded by the curves..which ever has least area is straight. A = [0 0.423891532 0.819380304 1.2...

6 years ago | 0

Answered
Matrix "User Define"
What you gave is a combination of numbers and strings.....this cannot be acieved by a matrix. But you can use cell arrays for th...

6 years ago | 0

Answered
Solve the equation for x
Repalce exp.^() with smply: exp() Also element by element operation not reuqired: fun = p* exp(-exp((v-x)/a)) + r* exp(-((...

6 years ago | 2

| accepted

Answered
How to get X and Y coordinates from a Sparse Matrix?
If A is your sparse matrices. You can get positions using: [y,x] = find(A) ; % x, y are the positons/indices of non-zeros ...

6 years ago | 0

| accepted

Answered
Index exceeds the number of array elements (1).
The error is clear...you are trying to extract more number of elements than present int he array. A = rand(1,10) ; A(1) %...

6 years ago | 0

Answered
Plot exactly root of polynomial degree=3
p = [1 -1 0 -10] ; % polynomial coefficients r = roots(p) ; % get roots %% plot x = linspace(0,10); y = polyval(p...

6 years ago | 0

Answered
How to vectorize matrix assignment process below
Read about sub2ind. Convert your sub indices into global indices and use. idx = sub2ind(size(A),2*i-1,2*i-1) ; A(idx) = a(i) ...

6 years ago | 1

| accepted

Answered
How to calculate the value of the vector A in equation AXA' = b?
syms x y A = [x y] ; X = rand(2) ; b = rand ; eqn1 = A*X*X'- b ==0 s = solve(eqn1,x,y) ; x = double(s.x) y = double...

6 years ago | 0

| accepted

Answered
Generating 2D Geometry with MATLAB and Exporting to FEM software
Yes it is very much possible.. but you need to enter the details of FEA/ FEM mesh in the format which software demands. Already ...

6 years ago | 0

Answered
need help with writing a script that will solve the problem here is what i started with
Hints: x = linspace(0,1,100); y = linspace(0,1,100) ; [X,Y] = meshgrid(x,y) ; Z = X.^2+Y.^2 ; surf(X,Y,Z) shading interp ...

6 years ago | 1

Answered
How can I read multiple mat files and perform ttest2 function?
This question has been discussed to death. A simple search will give you lot of links. matFiles = dir('*.mat') ; N = length(...

6 years ago | 0

Load more