Réponse apportée
Storing data in an array from a for loop
You don't need to read your file line by line. textscan can scan the entire file in one pass (unless the format spec keep changi...

presque 6 ans il y a | 0

Réponse apportée
Use a wildcard to look for values in struct
Is there only one middle field ? If thats the case you can do as follows % s = your struct f = filednames(s); v = getfield(s...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
How to input a specific data into Matlab Gui uitable via clicking a button?
The reason is because your second line of code overwrites your previous assignment. You need to specify the column in your code...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
Find a specific set of values in a matrix
You can do this quite easily twocolmat = rand(100,2); idx = twocolmat(:,1) >= 0.2; col2vals = twocolmat(idx,2);

presque 6 ans il y a | 2

Réponse apportée
How to use the fillmissing function to interpolate at certain points
You can directly use interp1 to interpolate at your desired time intervals. t = 1:100; v = zeros(1,100); % here v is the value...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Creation of a .dat files in a for loop
% assume some values mx_inelastic = rand(30001,2434); my_inelastic = rand(30001,2434); mz_inelastic = rand(30001,2434); phy...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
How do I separate a data set into separate cell arrays according to the integer on the end of a string?
You need to extract the digit at the end. % c = yourcell array digit = regexp(c(:,4),'\d+$','match','once'); [u_d,i,j] = uniq...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Double summation in matlab
You can define a function to calculate the expression inside the brackets. a = @(p,param)param.^p./factorial(p); % (param^n)/fa...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Dividing cyclical data in array
Assuming you can get the locations of the peak, you can create an id variable. % acc = ... m x 1 array %locationidxofpeak = so...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Variable Depth Struct Field Reference
You can use the subsref function to index into the struct. You need to create the variable s dynamicall. To assign you can use ...

environ 6 ans il y a | 1

Réponse apportée
Wait for a button to be pressed to continue the function - APP DESIGNER
Instead of a button, you can change it to a state button in app designer Then in your code just use a while loop to check the v...

environ 6 ans il y a | 3

| A accepté

Réponse apportée
How to compare pair of rows in a column and report it in hexadecimal format
data = rand(512,1); oddrows = data(1:2:end); evenrows = data(2:2:end); response1 = oddrows > evenrows; response2 = evenrows ...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
changing continuous transfer function
You should just define your transfer function as a function. You can then just pass in the values you want to evaluate on. H = ...

environ 6 ans il y a | 0

Réponse apportée
Storing data in a real time recording gui using a callback
Instead of concatenating the data with every iteration, just store the data in a cell array. You can concatenate it when you nee...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Read Time from the column of CSV file for plotting purpose
readtable should work just fine with your data. a = readtable('Moxy.csv'); plot(a.hh_mm_ss,a.SmO2Live)

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to indicate if the program is processing in app designer?
Use the function dlg = uiprogressdlg(app.UIFigure); See documentation for all available options with the function.

environ 6 ans il y a | 0

Réponse apportée
What can I do to further vectorise this code?
Have you tried the function islocalmax and islocalmin ? maxIndices = islocalmax(x(:,2)); minIndices = islocalmin(x(:,2));

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to assign points to one or several boxes
Would this be fine. The point C will be repeated twice as in two boxes. lat = [47.5, 45.5, 46.5]'; lon = [-63.5, -61.5, -62.5]...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Finding two layers to replace in googlenet
For R2018a, you can follow this tutorial. Essentially it shows you what the findLayersToReplace function was doing. For most tr...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
comparing many plots with their peak values
load('test.mat'); [~,i1] = max(biggest_hg1); x1 = (1:length(biggest_hg1)) - i1; [~,i2] = max(biggest_hg2); x2 = (1:length(bi...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
How do I import a table containing numbers in a picture with OCR?
Try resizing the image. It would hopefully improve the accuracy. a = imread('image.jpeg'); a = imresize(a,2); txt = ocr(a,'Ch...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to create an array that picks every 3 numbers out of 5
a = reshape(1:665,5,[]); a(1:2,:) = []; a = reshape(a,[],1); a(:,2) = 0;

environ 6 ans il y a | 0

Réponse apportée
how to get cumulative percentage
gs = cumsum(g); gs = gs / gs(end) * 100; plot(t,gs)

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Random but equal distribution of numbers 1 and 2
You can try this l = 50 a = rand(l,1); a = (a > median(a)) + 1;

environ 6 ans il y a | 0

Réponse apportée
join words for a title in plot
You have put '' around name. That makes it a static char name='function'; x = 0:pi/100:2*pi; y = sin(x); plot(x,y) title(['...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Ismember as a condition?
Yes needed to combine with the time column. load Obs.mat load WRF.mat WRF_Data.Date = WRF_Data.Date + duration(hour(WRF_Data...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Loop through sub folders.
mainfolder = uigetdir; subfolders = dir(mainfolder); subfolders = subfolders([subfolders.isdir] & ~startsWith({subfolders.name...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Find Interval in Array With Most Updates
Another option can be % this will work for integer times times = [1 2 3 4 6 7 10 12 14 15 17 19 20 21 29 30 32 34 36 37 40 41 ...

environ 6 ans il y a | 0

Réponse apportée
summing elements of an array until a value appears
a = [1 1 1 2 3 4 2]; i = find(a==2,1,'first'); if ~isempty(i) val = sum(a(1:i)); else val = sum(a); end

environ 6 ans il y a | 1

| A accepté

Réponse apportée
saving multiple .mat files different names
[hdr,record] = edfread(muestra); recordname = sprintf('record_%i',trial); matFileName = matfile(fullfile(pwd, sprintf('angry_%...

environ 6 ans il y a | 0

| A accepté

Charger plus