Respondida
Lookup values in ranges of a table and copy a corresponding output value in another table
A = load('A') B = load('B') [~,idx] = ismember(B.Events.Lap,A.Events.Lap); result = A.Events(idx,:)

casi 4 años hace | 1

| aceptada

Respondida
imread with new name
Instead of 50 different variables named ImageID_1, ImageID_2, etc., how about one variable (a cell array) that contains all 50 i...

casi 4 años hace | 0

| aceptada

Respondida
How do I get a value in a table with a known index?
data = readmatrix('22-08-2022_12-59-07_Results.txt'); data(47,3)

casi 4 años hace | 0

| aceptada

Respondida
Create a 24x1 structure from three arrays
Assuming your arrays are time, nid, name, here's how you can make a table: % the three arrays you have: time = [27; 36; 42]; ...

casi 4 años hace | 0

| aceptada

Respondida
What stands for LTI in mathlab
Linear time-invariant.

casi 4 años hace | 0

Respondida
Same values in matrix column
Here is a way: m = [1 2; 1 5; 1 8; 2 4; 2 5]; [mm,~,jj] = unique(m(:,1)); n = numel(mm); result = [mm zeros(n,nnz(jj == mo...

casi 4 años hace | 0

| aceptada

Respondida
I am having trouble saving a value and calculating new values from it.
n = 180; a = zeros(1,n); b = zeros(1,n); e = zeros(1,n); a(1) = 20000; R = 0.06; r = R/12; z = amortization(a(1),R,n); f...

casi 4 años hace | 0

| aceptada

Respondida
How to extract the data in a column with the information of another column
t = readtable('3kmFES_001a.xlsx') t_LR_F_Double = t(t.DoubleContact == 1,{'RIGHT_Fz_N_' 'LEFT_Fz_N_'})

casi 4 años hace | 1

| aceptada

Respondida
Deleting Elements in a Structure - Error Matrix Index is Out of Range
x.score = [98 75 22 75 29]; x.count = [1 2 3 4 5]; x.count<4 is a 1x5 logical array x.count<4 x(x.count<4) = [] would try to...

casi 4 años hace | 0

| aceptada

Respondida
Making loop to create graphs
Something along these lines: folder = 'your\folder\path'; files = dir(fullfile(folder,'*.txt')); hold on for ii = 1:numel(...

casi 4 años hace | 0

Respondida
Match two variables list
c = ["80ms,110ms", "110ms,140ms", "140ms,195ms", "195ms,250ms", "250ms,400ms", "400ms,550ms", "550ms,725ms", "725ms,900ms"] c_t...

casi 4 años hace | 0

| aceptada

Respondida
How do I count the number of Functions in a Function Handle?
It sounds like you actually want to count the number of elements in the vector returned by your function handle, in which case y...

casi 4 años hace | 1

Respondida
Explanation of this function
size(x,1) is the size the array x in the first dimension, i.e., the number of rows of x. Reference: https://www.mathworks.com/h...

casi 4 años hace | 0

Respondida
How to select sections of signal using a for loop and waitfor?
I don't think waitfor is closing the figure. Perhaps the figure is closed by subsequent code not seen here, or maybe what you ar...

casi 4 años hace | 0

| aceptada

Respondida
How to format a series of filenames with different characters as endings?
Make unitletters a cell array, using {}, and fix your cellfun syntax: unitletters = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i...

casi 4 años hace | 0

| aceptada

Respondida
How to sort all rows in one table based on one row from the table and another table
t1 = table( ... {'Mom';'Dad';'Sister'}, ... 'VariableNames',{'Names'}) t2 = table( ... {'Sister';'Mom';'Dad'}, ....

casi 4 años hace | 1

| aceptada

Respondida
Summation of all odd numbers from 1 to 451
The for loop iterates n times, so after it's done, S represents the sum of n terms, which is fine when d = 1, but when d > 1, th...

casi 4 años hace | 1

Respondida
Size mismatching using "find" command
for i=1:length(FileList) idx = find((floor(mean_GMT_min_mean_ref(i,:))==2),1,'first'); if isempty(idx) y(i,1)...

casi 4 años hace | 0

| aceptada

Respondida
How do I copy some files to another folder?
for j = 1:size(file_list,1) copyfile(file_list(j),destination_folder) end

casi 4 años hace | 0

| aceptada

Respondida
while trying to automate keyPress event in a loop, I get the error: "Unrecognized function or variable 'VK_i'
key = java.awt.event.KeyEvent.(sprintf('VK_%d',i));

casi 4 años hace | 0

| aceptada

Respondida
display variables with different classes
Maybe use fprintf for this a = [0.0029 0]; b = {0 0.5 0.5 10}; c = '20220807T063730'; fprintf(1,'%s',c) fpr...

casi 4 años hace | 0

| aceptada

Respondida
for loop index picking only elements of given vector
for j = V

casi 4 años hace | 0

| aceptada

Respondida
for loop for two particular days of a week
n_weeks = 50; vec = reshape((0:n_weeks-1)*7+[1;4],1,[]);

casi 4 años hace | 1

Respondida
Find lower query points compared to the Reference vector
load data.mat; idx = zeros(size(Beg_Data)); for ii = 1:numel(Beg_Data) idx(ii) = find(Beg_In_Ex <= Beg_Data(ii),1,'last...

alrededor de 4 años hace | 0

| aceptada

Respondida
loop to extract rows and giving the vectors progresseiv numbers
There's no need to make each of several rows of a matrix into its own variable (M1, M2, etc.) https://www.mathworks.com/matlabc...

alrededor de 4 años hace | 0

| aceptada

Respondida
Graph matrix B with colormap based on matrix A
cq = griddata(x,y,A(:,3),xq,yq); mesh(xq,yq,zq,cq)

alrededor de 4 años hace | 0

| aceptada

Respondida
how to solve 'ones error' in my code below
nf should be an integer.

alrededor de 4 años hace | 0

| aceptada

Respondida
After the if statement is ran why is the answer 10?
A=1; B=2; C=10; if A<0 % false (1 is not less than 0) % ... nothing in here executes end disp(C) % C remains 10

alrededor de 4 años hace | 0

| aceptada

Respondida
I have a problem with my plot. I need to plot one curve for every value of the matrix "Vgs", but i need all the curves in one graphic (and considering the conditions)
hold on clear k = 1; % use semi-colons to suppress command-line output Vt = 0.6; L = 0.01; Vds = linspace(0,5,200); Vgs = ...

alrededor de 4 años hace | 0

Respondida
i have to plot the percentage of heads by the times token is trowed times, in a game of head or tail, but a need help for doing that. What can I use in my plot?
% N = input('Coloque um valor para N: '); N = 2500; x = round(rand(1,N)); figure histogram(x); title('Total #') xticks([...

alrededor de 4 años hace | 0

Cargar más