solve first-order ODE
ode = @(t, Y) sin( exp(Y - t/2) - t^2/2 ) ode45(ode, [0 2*pi], 0)

casi 2 años ago | 0

Creating an array of dependent symbolic variable
A(x) = str2sym(regexprep(char(A), '(\_?\d)+', '\$0(x)'))

casi 2 años ago | 0

| accepted

splitting up numbers in a cell of a double
Wanted = vertcat(cell_array{:}) %or Wanted = cat(1, cell_array{:})

casi 2 años ago | 0

How can I asign columns of a matrix to different matrixes?
permute(reshape(matrix, 154, 558, []), [2, 1, 3])

casi 2 años ago | 1

| accepted

what's going on?
plot(A.' , '-x')

casi 2 años ago | 0

テキストファイルから特定の行、列の読み込み

casi 2 años ago | 0

| accepted

substitute only first derivative in symbolic toolbox
I remember doing vibration analysis, used to be pretty tricky: expr2 = subs(expr, diff(x, 2), diff(v))

casi 2 años ago | 0

| accepted

MATLAB Answers Wish-list #5 (and bug reports)
When someone tries to answer a homework question (when it has a tag), it could restrict the answered to post the full solution(s...

casi 2 años ago | 0

Summing an array and plotting it.
doc cumsum doc plot

casi 2 años ago | 0

If statement for the structure in table
FIND_rows_of_A = find(strcmp(T.alphabet, 'A')) %or FIND_rows_of_A = find(ismember(T.alphabet, 'A')) [Alphabets, ~, c] = uniqu...

casi 2 años ago | 0

| accepted

How to enter variable names into plot title (R2019a)
title(sprintf('2D Gaussian when mean is %.2f and standard deviation is %.2f', m(ii), s(ii)))

casi 2 años ago | 0

| accepted

Syms dependent on time vector notation
formula(du)

casi 2 años ago | 0

| accepted

Identify a number in a string
Wanted = str2double(regexp(Ans, '(+|-)?(\d+)?\.?\d*', 'match'))

casi 2 años ago | 0

| accepted

Find the theta1 and theta2 values that maximize the function
obj8Run = @(theta) -mean(sum((1+theta(1).*csecxit+theta(2).*csecyit)/N.*R4-c*t4,2))./sqrt(sum((1+theta(1).*csecxit+theta(2).*cse...

casi 2 años ago | 0

[大至急お願い致します] for文の入れ子に関しまして
[d, c, b, a] = ndgrid(1:10); fun = @(a,b,c,d) (a + b).^c .* d; fun(a(:), b(:), c(:), d(:))

casi 2 años ago | 1

casi 2 años ago | 0

Convert String to Numerical Matrix
Normally str2num() is not suggested: Wanted = sscanf(A(2:end-1), '%d').' % edited after sir Walter’s comment to exclude []

casi 2 años ago | 1

| accepted

Add terms to previously defined differential equation (Symbolic)
eq_damped = lhs(eq_undamped) + damping == rhs(eq_undamped)

casi 2 años ago | 2

| accepted

finding the mean based on a specific value in other column
ix = (abs(column_1 - 527.1235) < 1e-4) &... (abs(column_1 - 927.5) < 1e-1); M = mean(column_4(ix))

casi 2 años ago | 0

How to assign value to variable
syms Y equation = Y + 5 == 10

casi 2 años ago | 0

Counting in a loop
Note: Never name a variable times. function TimeS = timeLoop(startVelocity, distance) TimeS = zeros(size(startVelocit...

casi 2 años ago | 0

How to place values in vectors from a text file
T = readtable('Test.txt', 'ReadVariableNames', 0); C = cellfun(@(x) sscanf(x, '%d').', T{ismember(T{:, 2}, 'tag'), end},... ...

casi 2 años ago | 0

What are the obsessions you saw in MATLAB Answers or in MATLAB programming?
Have to use MATLAB even for a simple calculation eventhough it could be done in mind.

casi 2 años ago | 3

take input in array
Use input() , enter the values in the form [1,5,4] an example. doc input

casi 2 años ago | 0

Output simpler version of symbolic polynomial expression
syms x y a b z = a*x^2 + 2*a*x*y + b + a*y^2; simplify(collect(z, a), 'Steps', 50)

casi 2 años ago | 0

Non square matrix rotation
matrix.'

casi 2 años ago | 1

| accepted

Mean between an interval
x = 1:5; x(.2) % error x(2) % no error , index can only be integers not decimals I suggest you to do MATLAB Onramp course.

casi 2 años ago | 0

issues with syms function
You have a custom file named sym.m , remove it from the path or rename it.

casi 2 años ago | 0