Beantwortet
How can i find row and column numbers of max value of each field in structure?
clear,clc s.ciao = rand(5); s.hello = rand(5); s.hola = rand(5); s.max = [max(s.ciao(:));max(s.hello(:));max(s.hola(:)...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to save a vector 1x k in each element of an m by n matrix?
clear,clc for x=1:368 for y=1:3 for k=1:8760 soc(x,y,k)= it has its equation end en...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
how to select last elements of a row vector?
j = [593,660,725,790,854,919,984,1050,1118,1184, 1300, 1400, 1500, 1600]; j_last5 = j(end-4:end) j_last5 = 1184 ...

etwa 4 Jahre vor | 1

Beantwortet
Display equation of exponential fitted line using fit function
See if this works clc clear T = readtable('ViscosityResults.xlsx','Range','L2:M14',... #read spreadsheet and...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Find local min point in plot between range
A way of doing this could be the following. clear,clc wavelength = 0:100; % Waveleng...

etwa 4 Jahre vor | 1

Beantwortet
Unrecognized function or variable
clear,clc E = 0; W = 2; A = 1; t = (0:1.0:10)'; y = B2FrequencyResponse10(t,E,W,A); plot(t,y) title('Step Response of...

etwa 4 Jahre vor | 0

Beantwortet
An easy way for adding on pervious row that expands
x = [100; 200; 50; 100]; Muliple = 0.1; x1 = zeros(size(x)); x1(1) = x(1)*Muliple; for i = 2:length(x) x1(i) = (x(i)...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
assigning points to clusters using index array
points = [1 5; 2 6; 4 8]; N = size(points,1); n = N+mod(N,2); x = zeros(1,n); y = x; x(1:N) = points(:,1); y(1:N) = points...

etwa 4 Jahre vor | 0

Beantwortet
How to construct a N x N window that moves about an array (R) to calculate the number of a certain element in the window.
You could create a function where you input the starting point of the NxN submatrix (i.e. the row and column representing the to...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
Converting dates in time series
Take a look at this date = '27-Feb-2007 12:00:00'; str = datestr(datenum(date),'yyyy.dd.mm') str = '2007.27.02' ...

etwa 4 Jahre vor | 0

Beantwortet
Problems using parfor loop
For the first problem, write this AA = [4 5 6]; parfor r = 1:5 Idx(r)= max(AA); end TT = Idx; Regarding the second one...

etwa 4 Jahre vor | 0

Beantwortet
How to get the solutions of inverse cosine (acos) in the interval [0, 2π]?
n = 10; k = 1:n; omegas = sort([k*2*pi-acos(cos_omega),k*2*pi+acos(cos_omega)])' yields solutions up to [(2*n-1)*pi 2*n*pi]. ...

etwa 4 Jahre vor | 1

Beantwortet
How to function 𝑎𝐴 + 𝑏𝐵 → 𝑝P in ODE89
This should work: clear,clc tspan = [0,10]; y0 = [1,1,0]; [t,y] = ode89(@yourODEsystem,tspan,y0); plot(t,y) legend(...

etwa 4 Jahre vor | 0

Beantwortet
How to create this patterned matrix?
Generalizing for any nxn matrix clear,clc n = 9; A = zeros(n); for i = 1:n A(i,i+1:n) = flip(i:n-1); if i > 1 ...

etwa 4 Jahre vor | 1

Beantwortet
Having trouble modeling temperature flux through a building
The following code works % Identify Constants k1 = 0.2; % W/(m^2*K) k2 = 3; % range from 1 to 10 W/(m^2*K) k3 = 0.5; % W/(m^...

etwa 4 Jahre vor | 0

Beantwortet
how to fill an array with data from intercalated/multiple range columns
A1 = A(1:2000,[1:40,42:50]);

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to generate data using for loop and save in rows in MATLAB
Something like this? clear,clc Repeat=randi([1 1000], 1, 10); for i=1:200 prf=randi([1 1000], 1,10); DS(i,:) =r...

etwa 4 Jahre vor | 0

Beantwortet
For repeating values in a column calculate the corresponding adjacent columns
I have expanded it for cases where there are multiple repeated values. clear,clc A = [[(1:6)';(6:10)';(10:14)';(14:20)'],rand...

etwa 4 Jahre vor | 0

Beantwortet
find the location of a vector in a cell array and extract the last element of that vector
clear, clc A{1} = {[1,1,5] [1,2,5] [1,3,5] [1,4,5]}; A{2} = {[2,1,6] [2,2,6] [2,3,6] [2,4,6]}; tofind = [1 3; 2 4...

etwa 4 Jahre vor | 1

Beantwortet
How to detect and remove outliers in excel data using matlab
I'd try something like this clear, clc T = readtable('excelfilename.xlsx'); time = T.time(T.dni > mean(T.dni)-3*std(T.dni...

etwa 4 Jahre vor | 0

Beantwortet
How to normalize data between 0 and 1
Given the matrix A that you want to normalise, you could write A = A/max(A(:));

etwa 4 Jahre vor | 0

Beantwortet
How can I create a matrix that represents all possible "recipes" of 3 chemical components? (i.e., the 3 chemical components must be positive and sum to 100 wt%)
I am going to assume that the percentage of each compound can be rounded to the first decimal digit. Then I would recommend usi...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Why is my plot missing lines?
It actually plots 9 lines, but the 1st and 2nd are equal, and the same goes for the 4th and 5th, and 7th and 8th. So they over...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to create Matrix [1 2 3 4; 2 4 6 8; 3 6 9 12; 4 8 12 16] without using loops or any functions using loops?
To make it more general n = 4; a = 1:n; A = repmat(1:n,n,1).*a'; For instance, if n = 6 this will generate A = 1 ...

etwa 4 Jahre vor | 1

Beantwortet
Put name on above and left
All elements in an array must be of the same type, i.e. you cannot merge numbers with characters unless you turn the numbers int...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Error with Invalid indexing in system of differential equations
I think the problem is in the syntax of your last line. You should simply write sSol = dsolve(odes,conds); I run this on MatL...

etwa 4 Jahre vor | 0

Beantwortet
How to find the maximum value from a matrix without using max syntax?
I guess you could try something like this A = randi(100,4,8); for i = 1:size(A,1) for j = 1:size(A,2) if any(A(...

etwa 4 Jahre vor | 0

Beantwortet
How to make a function that outputs true or false (logical) if a number inputted is in a predetermined vector?
function testLucky % testLucky - determine whether x is a lucky number % return true (1) if x is a lucky number % return fals...

etwa 4 Jahre vor | 0

Gelöst


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

etwa 4 Jahre vor

Gelöst


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

etwa 4 Jahre vor

Mehr laden