Gelöst


MATLAB Basic: rounding II
Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9

etwa 4 Jahre vor

Gelöst


MATLAB Basic: rounding
Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

etwa 4 Jahre vor

Beantwortet
how to make an anonymous function with more than 1 statement or equation?
B=2; C=4; f=@(x) B*x +C*x^2; % d=@(x) C*x^2 sqrt(f(2))

etwa 4 Jahre vor | 0

Gelöst


Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

etwa 4 Jahre vor

Gelöst


Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

etwa 4 Jahre vor

Beantwortet
Stacked bar graph with repeating datetime
A=readtable('Project1.xlsx', 'PreserveVariableNames', 0); AA=table2array(A); B = regexp(table2array(A), '\s+', 'split'); % sp...

etwa 4 Jahre vor | 1

Gelöst


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

etwa 4 Jahre vor

Beantwortet
Why is my plot shaking but not plotting the noise?
x = 0:pi/200:(2*pi);% does't need e = rand; % does't need y = x.*sin(x)+(0.5*e); % does't need x_star = 0:(pi/200):(2*pi); ...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
An integer multiple a function
I dont know the value of n. I took it 200. A=load('ecg_hw2.mat'); ecg=A.ecg ; N = [2 4 8 16 32]; b = 1./N; ye = cell(size(b...

etwa 4 Jahre vor | 0

Beantwortet
how do i plot the output with constant input
Vonew=45; vin=30; y=Vonew; %i get my Voutnew=45 plot( vin,y, 'o', 'LineWidth', 2); xlabel('vin', 'FontSize', 20); ylabel('v...

etwa 4 Jahre vor | 0

Gelöst


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

etwa 4 Jahre vor

Gelöst


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

etwa 4 Jahre vor

Gelöst


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

etwa 4 Jahre vor

Gelöst


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

etwa 4 Jahre vor

Beantwortet
Adding date to timetable with just time
follow this https://www.mathworks.com/matlabcentral/answers/288524-how-do-you-separate-the-contents-of-one-cell-into-separate-c...

etwa 4 Jahre vor | 0

Beantwortet
How to add a first row and a first column of zeros in a matrix?
A=[1 2 3; 4 5 6; 7 8 9]; AA=[zeros(1,3);A]; AAA=zeros(4,1); B=[AAA AA]; B(:,end)=[]; B(end,:)=[]

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to extract monthly data in a matrix
As you did not attach any data, i took the random data A=readtable('Data.xlsx'); Data=table2array(A(:,2)); Year=(1971:2000)';...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Subtracting elements within a table
A=[1 23 2 24 3 21 4 34 1 89 2 23.2 3 34.8 4 -23.1]; My_Table= table(A(:,...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
non zero elements in an array
a=[1 2 4 5 3 0 0 8 0]; [idx]=find(a<2); a(idx)=0; out=a; [idx2]=find(out>=2); out(idx2)=1

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Getting a compound matrix to work
n=[1,3,16]; P=800; t=20; format shortG y=P.*(1+t/100).^n-P; % Compound Interest,C.I.= P × (1+t)n - P Year_1=y(1); Year_3=...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Compare two vector arrays and if they match set vector array 2 = nan?
Try this... time = [0,0,0,0,2,3,4,5,5,6,7,8]; solution = [1,2,0,0,1,1,2,2,2,0,0,0]; [idx]=find(time==solution); solution(id...

etwa 4 Jahre vor | 0

Beantwortet
Difference between two time values in minutes
t1 = {'08/24/2010 13:21:47.030'}; t2 = {'08/24/2010 14:13:09.118'}; dt= diff(datenum([t1;t2]))*24*60 % to get the second sec...

etwa 4 Jahre vor | 1

Beantwortet
Adding text to plot with random inputs
y=20*randn(1,100000)+80; histogram(y,11) title('Normal Distribution') xlabel('Value'); ylabel('Count'); txt1={'\mu = 80'}; ...

etwa 4 Jahre vor | 0

Beantwortet
how to add timestep iteration and show all iteration in plot
time = [4 50] ; points = [20 100] ; % interpolation step_count = time(1):0.1:time(2) ; % timestep 0.1 expected_points = inte...

etwa 4 Jahre vor | 0

Beantwortet
Loop through array containing coordinates points
Try this... p0 = [1, 1]; p1 = [2, 3]; p2 = [4, 3]; p3 = [3, 1]; cords = [p0, p1, p2, p3]; N=length(cords); for i = 1:leng...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
how to make "two matrixes → one matrix repeated colum"
please have a look here https://www.mathworks.com/matlabcentral/answers/266969-combine-two-matrices-every-other-column

etwa 4 Jahre vor | 0

| akzeptiert

Gelöst


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...

etwa 4 Jahre vor

Gelöst


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

etwa 4 Jahre vor

Beantwortet
Matlab filter columns of array based on value in row
use 'find' function to look up the value which is equal to 3 in 'z' x=randi(100,3,3000); y=randi(80,3,3000); z=randi(50,3,30...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
color in output in matlab
It might be helpful https://www.mathworks.com/matlabcentral/answers/15328-adding-color-in-command-window-output a=[1 2 3 4 4];...

etwa 4 Jahre vor | 0

| akzeptiert

Mehr laden