Respondida
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(:)...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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 ...

más de 4 años hace | 1

Respondida
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...

más de 4 años hace | 0

| aceptada

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

más de 4 años hace | 1

Respondida
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...

más de 4 años hace | 0

Respondida
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)...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 1

| aceptada

Respondida
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' ...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 0

Respondida
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]. ...

más de 4 años hace | 1

Respondida
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(...

más de 4 años hace | 0

Respondida
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 ...

más de 4 años hace | 1

Respondida
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^...

más de 4 años hace | 0

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

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 1

Respondida
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...

más de 4 años hace | 0

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

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 1

| aceptada

Respondida
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 ...

más de 4 años hace | 1

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

Respondida
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(...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 0

Resuelto


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.

más de 4 años hace

Resuelto


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

más de 4 años hace

Cargar más