Beantwortet
How to find the values and their corresponding index from the list which is stored on a variable?
out_index = info_1(info_1(:,1) == 10,2)

mehr als 8 Jahre vor | 0

Beantwortet
Making one column from two columns
B1 = [B;0]; out = reshape([A(:)';B1(:)'],[],1); out = out(1:end-1);

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
If-statements within a for loop does not respond to my counter appropriate?
val = [25000; 75000; 200000]; op0 = name1 >= 10 & name == 1; x = zeros(size(name)+[1 0]); a = diff([0;op0(:);0]); ...

mehr als 8 Jahre vor | 0

Beantwortet
how to combine two matrices in a specific order
a = 1:3; b = (5:7)'; out = [a(:),b(:)];

mehr als 8 Jahre vor | 0

Beantwortet
I want to create a table from this for loop for each different value the overtimesalary and salary
S = 12; t = 20:50; your_salary = S*t; your_salary(t > 40) = S*(40+1.5*(t-40));

mehr als 8 Jahre vor | 0

Beantwortet
how can I make a table for this loop
cumprod(1:20)

mehr als 8 Jahre vor | 0

Beantwortet
How do I store function values in a vector while using a nested for loop?
Maybe so? k=23; x=drifter.long{1,k}; y=drifter.lat{1,k}; z=drifter.mtime{1,k}; n = length(z); A = [x(:...

mehr als 8 Jahre vor | 0

Beantwortet
How to create a for loop to subject 1st 2d matrix by 2nd 2d matrix to for a new 3d matrix
Let |Cube| - your data [500 x 500 x 20]: Cube_new = -diff(Cube,1,3);

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
How to add variables to a table that are products of other variables
Let T - your table. ts = reshape(T{:,[10,12:18]}.^reshape(2:3,1,1,[]),size(T,1),[]); newname = cellstr(reshape(string(T(...

mehr als 8 Jahre vor | 0

Beantwortet
How to use find when some of the searches will not return a result?
[X, Y] = meshgrid([2.5:5:357.5],[-76:4:80]); [m n] = size(X); Z = nan(m,n); for ii=1:m for jj=1:n k...

mehr als 8 Jahre vor | 0

Beantwortet
String selection from Matrix data
Names(end+1) = {'none'}; Selection(Selection == 0) = numel(Names); out = Names(Selection); or out = cellfun(@(x)...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
Convert to a function
>> calender1 = @(day1,month1,year1)datenum(year1,month1,day1) - datenum(year1 - 1,12,31); >> calender1(3,1,2017) ans = ...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
How to resize image of 511*511 to 512*512 in matlab?
imresize(your_image,512/511)

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
Vectorization, check if points coordinate is exist in an image or no
ii = coordinates; d3 = N(ii(:,1),ii(:,2)); signVector = -ones(numel(d3),1); signVector(d3 ~= 1) = 1;

mehr als 8 Jahre vor | 1

Beantwortet
creating multidiagonal matrix from a basic square matrix
A = magic(3); n = 8; B = repmat({A},1,n); out = blkdiag(B{:});

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
Horizontal average on Image
A = imread('Nature.jpg'); I = imrotate(A,90,'bilinear','loose'); grey = 0.21*I(:,:,1)+0.72*I(:,:,2)+0.07*I(:,:,3); G...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
How can I compute the leap years?
Please write script - file |now1.m|: out = leapyears(2000,2030) function out = leapyears(startYear,endYear) y = (...

mehr als 8 Jahre vor | 1

Beantwortet
Finding values on only time (excluding date)
T = readtable('data1.xlsx'); T.Date_Time = datetime(join(string(T{:,1:2})),'I','dd-MM-uuuu HH:mm'); T = T(:,[1,3:end]); ...

mehr als 8 Jahre vor | 0

Beantwortet
How to create multidimensional matrix from X and Y coordinates?
T = readtable('temperature_values_.xls'); data = T{:,:}; out = permute(reshape(data',size(data,2),4,[]),[2, 3, 1]); o...

mehr als 8 Jahre vor | 0

Beantwortet
Moving sum of a matrix
exotics: [m,n] = size(A); B = reshape(permute(cat(3,A,zeros([m,n,N-1])),[3,1,2]),[],n); out = sum(spdiags(B(1:end-1,:...

mehr als 8 Jahre vor | 1

Beantwortet
how to insert elements to get a new output
cv = '000001010011100101111'; k = 3; out = reshape([reshape(cv,k,[]);sprintf('%d',(rem(0:numel(cv)/k-1,k)+1)')],1,[]...

mehr als 8 Jahre vor | 1

Beantwortet
How to sum a specified range of rows in a matrix?
Let A - your array [5000x6482] d = 16; ii = rem((0:size(A,1)-1)',d)+1; [x,y] = ndgrid(ii,1:size(A,2)); out = a...

mehr als 8 Jahre vor | 0

Beantwortet
create a new pattern with a string
m = 84; [s,~,c] = unique(str1,'stable'); n = numel(c); out = s(c(rem(0:m-1,n)+1)); or m = 84; k = ...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
How can I carry out overlap string match
strfind('QEAFEISKXXXXXXX','XX')

mehr als 8 Jahre vor | 0

Beantwortet
how to get the coinciding value of a particular row and column
[U,I] = find(ismember(tabl1,{'U','I'})) out = tabl1(U(1),I(2)) or fun0 = @(M,v1,v2)M(any(ismember(M,v1),2),any(isme...

mehr als 8 Jahre vor | 1

Beantwortet
How to reconstruct 2 column array to m*n array which is contain logic function that defined whether it have that specific row in that 2 column array or not.
[a,~,ii] = unique(A(:,1)); [b,~,jj] = unique(A(:,2)); out = [nan,a(:)';b,accumarray([jj,ii],1)]

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
How do I plot the time trajectories of x1(t) and x2(t) within t = [0 6*pi]? How do I plot the trajectory in the 2D phase plane(i.e.the x1-x2 plane)?
:) Please use function <http://se.mathworks.com/help/matlab/ref/ode45.html?s_tid=doc_ta |ode45|>. And use function <http://se...

mehr als 8 Jahre vor | 0

Beantwortet
How to plot trajectories of ODE system solutions.
Please use function <http://se.mathworks.com/help/matlab/ref/ode45.html?searchHighlight=ode45&s_tid=doc_srchtitle |ode45|>. And ...

mehr als 8 Jahre vor | 0

Beantwortet
How to append a row of NaN to end of cell matrices?
cellfun(@(x)[x;nan(1,2)],A,'un',0)

mehr als 8 Jahre vor | 0

| akzeptiert

Mehr laden