Answered

How do I save filenames in a for loop for later access?

C = cell(nnz(~fn(k).isdir), 1); % before loop function C = filnamn(katalog) % displays the names of all files in given diretor...

How do I save filenames in a for loop for later access?

C = cell(nnz(~fn(k).isdir), 1); % before loop function C = filnamn(katalog) % displays the names of all files in given diretor...

9 months ago | 0

| accepted

Answered

Why do I get the error "Unrecognized function or variable" with this

I don't know why you deleted your question and changed your name. 1) Why do you name a variable as the same name of a FUNCTION....

Why do I get the error "Unrecognized function or variable" with this

I don't know why you deleted your question and changed your name. 1) Why do you name a variable as the same name of a FUNCTION....

10 months ago | 0

| accepted

Answered

Integral2 Error message

F = @(x,y) x./y + y./x q = integral2(F,1,2,1,4)

Integral2 Error message

F = @(x,y) x./y + y./x q = integral2(F,1,2,1,4)

10 months ago | 0

| accepted

Answered

How do I indicate phase changes on my velocity versus time plot on MATLAB?

t = [1.85 2.87 3.78 4.65 5.5 6.32 7.14 7.96 8.79 9.69]; d = 10: 10 : 100; v = gradient(d) ./ gradient(t); figure(1) dvdt = g...

How do I indicate phase changes on my velocity versus time plot on MATLAB?

t = [1.85 2.87 3.78 4.65 5.5 6.32 7.14 7.96 8.79 9.69]; d = 10: 10 : 100; v = gradient(d) ./ gradient(t); figure(1) dvdt = g...

10 months ago | 0

Answered

Error with plotting a function

K = 10; r = .1; t = 0:1:100; solution1 = @(t,y) K .^ (1 - (exp(-t*r))); plot(t,(K.^(1 - (exp(t*r*-1)))), '-b');

Error with plotting a function

K = 10; r = .1; t = 0:1:100; solution1 = @(t,y) K .^ (1 - (exp(-t*r))); plot(t,(K.^(1 - (exp(t*r*-1)))), '-b');

10 months ago | 0

| accepted

Answered

Specify the y value where the graph should start

%Variabler A_sveip = 2.27; luft_tett = 1.225; %Virkningsgrad v_0k5 = [0:0.5:30.5]; P_0k5 = [0 0 0 0 0 20 30 50 70 95 120 ...

Specify the y value where the graph should start

%Variabler A_sveip = 2.27; luft_tett = 1.225; %Virkningsgrad v_0k5 = [0:0.5:30.5]; P_0k5 = [0 0 0 0 0 20 30 50 70 95 120 ...

10 months ago | 0

| accepted

Answered

Position of element in a row

Use second output of find() help find

Position of element in a row

Use second output of find() help find

10 months ago | 0

| accepted

Answered

Breaking equations down into parts while retaining output

atimesb = a * b; ctimesd = c * d; eqn = MyTotal == atimesb + ctimesd

Breaking equations down into parts while retaining output

atimesb = a * b; ctimesd = c * d; eqn = MyTotal == atimesb + ctimesd

10 months ago | 0

| accepted

Answered

Unrecognized function or variable

Following Steven’s answer would clear that error but you will have a following error, so change that part of your code to the fo...

Unrecognized function or variable

Following Steven’s answer would clear that error but you will have a following error, so change that part of your code to the fo...

10 months ago | 0

Answered

How do you name single output functions?

result = @(in) in.^2; result = result(1 : 10)

How do you name single output functions?

result = @(in) in.^2; result = result(1 : 10)

10 months ago | 0

Answered

Subtract rows and Save the outputs in a new column

Use readtable(), diff() and finally writetable().

Subtract rows and Save the outputs in a new column

Use readtable(), diff() and finally writetable().

10 months ago | 0

Answered

Display symbolic expressions as rational.

syms x sympref('FloatingPointOutput',true); (1/2)*(3*x^2) sympref('FloatingPointOutput',false); (1/2)*(3*x^2)

Display symbolic expressions as rational.

syms x sympref('FloatingPointOutput',true); (1/2)*(3*x^2) sympref('FloatingPointOutput',false); (1/2)*(3*x^2)

10 months ago | 0

| accepted

Answered

getting an equation from multiple variables

MAtrix = [3, 6, 1, 3, 8; 3, 6, 1, 3, 9]; syms x y z w Out Out * MAtrix(:, 1) == (MAtrix(:, 2 : end) * [x, y, z, w].') % someth...

getting an equation from multiple variables

MAtrix = [3, 6, 1, 3, 8; 3, 6, 1, 3, 9]; syms x y z w Out Out * MAtrix(:, 1) == (MAtrix(:, 2 : end) * [x, y, z, w].') % someth...

10 months ago | 0

Answered

Hi, I am new to matlab and i have been asked to create a function that takes a number as an input, and returns logical 1 for true if the input arguement is divisible by 4 and false if not thanks

Let’s start: help function help mod help if

Hi, I am new to matlab and i have been asked to create a function that takes a number as an input, and returns logical 1 for true if the input arguement is divisible by 4 and false if not thanks

Let’s start: help function help mod help if

10 months ago | 1

Answered

How to create a square matrix with zero on main diagonal and all 1's, 2's, 3's, ... n's on upper and lower diagonals?

help toeplitz

How to create a square matrix with zero on main diagonal and all 1's, 2's, 3's, ... n's on upper and lower diagonals?

help toeplitz

10 months ago | 0

Answered

Modify this code to compute the mean of the row vectors. Although there are only two rows still use a loop to add up A(1, :) + A(:, 2).

help mean help sum

Modify this code to compute the mean of the row vectors. Although there are only two rows still use a loop to add up A(1, :) + A(:, 2).

help mean help sum

10 months ago | 0

Answered

SS2TF Error

State space representation should be with numerical values and it cnnot contain symbolic values.

SS2TF Error

State space representation should be with numerical values and it cnnot contain symbolic values.

10 months ago | 0

Answered

Using a loop to calculate max values

You were almost close. plot(max(temp.temp, [], 2))

Using a loop to calculate max values

You were almost close. plot(max(temp.temp, [], 2))

10 months ago | 0

Answered

Using data from a table in matlab script

https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-table.html

Using data from a table in matlab script

https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-table.html

10 months ago | 0

Answered

How to make vector array value zero after certain index?

Matrix(556 : end, 1 : 2) = 0 % size 1001 X 4

How to make vector array value zero after certain index?

Matrix(556 : end, 1 : 2) = 0 % size 1001 X 4

10 months ago | 0

Answered

Converting txt file with words into equal-sized matrices

P.S: The word numbers was at the 21st column so that part was automatically excluded since you were interested in 19 columns onl...

Converting txt file with words into equal-sized matrices

P.S: The word numbers was at the 21st column so that part was automatically excluded since you were interested in 19 columns onl...

10 months ago | 0

| accepted

Answered

Recording variables that satisfy a condition

X = linspace(0,1,100); Y = linspace(0,1,100); Z = linspace(0,1,100); [XX, YY, ZZ] = meshgrid(X, Y, Z); XYZ = XX + YY + ZZ; ...

Recording variables that satisfy a condition

X = linspace(0,1,100); Y = linspace(0,1,100); Z = linspace(0,1,100); [XX, YY, ZZ] = meshgrid(X, Y, Z); XYZ = XX + YY + ZZ; ...

10 months ago | 0

| accepted

Answered

Centering Matrix Culumn Data

ii = 33 x = randi([0, 1], 4) * ii % they are automatically centered xD

Centering Matrix Culumn Data

ii = 33 x = randi([0, 1], 4) * ii % they are automatically centered xD

10 months ago | 0

| accepted

Answered

Why can't I calculate the definite integral?

h_min=0.5; h_max=1.16; pom_lc=1.21; syms t f = 1-exp(t/pom_lc) F = vpaintegral(f, t, [h_min h_max]) % double(), vpa() will ...

Why can't I calculate the definite integral?

h_min=0.5; h_max=1.16; pom_lc=1.21; syms t f = 1-exp(t/pom_lc) F = vpaintegral(f, t, [h_min h_max]) % double(), vpa() will ...

10 months ago | 0