Answered
Error using ELM Too many input arguments.
I assume you are using ELM.m from here: https://www.mathworks.com/matlabcentral/fileexchange/75653-elm Note that that function...

4 years ago | 0

Answered
2D Interpolation & Extrapolation with non linear Sample grid points and nan
V = [ ... 1.029 1.000 1.060 1.048 nan nan nan 1.049 1.014 1.038 1.092 1.075 nan nan ...

4 years ago | 2

| accepted

Answered
How to get average value of a matrix?
Test = [6,6,6,6,6,6,6,6,6,6,6,6,12,12,12,12,12,18,18,18,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,30,30,36,...

4 years ago | 1

| accepted

Answered
Take a few cells of 100 excel files and make of it 1 excel file
Something along these lines might work for what you want to do: % your data directory and output file name: data_dir = 'C:\ful...

4 years ago | 0

Answered
How to make 3 arrays (Test , Test2, Test3) that are of different lengths into one matrix?
Since the vectors are of differing lengths, the resulting matrix will have to have some values fill out the remaining elements i...

4 years ago | 1

Answered
Exclude data points from 2 arrays, based on a 3rd array
a = [533 534 535 536 700]'; b = [123 124 125 126 200]'; c = [11100010010 11100010010 11100010010 11100010010 11100010011]'; ...

4 years ago | 0

Answered
Replace certain row values in a cell based on a condition
C = {'stringA'; 'stringA'; 'stringB'; 'stringA'} C_logical = strcmp(C,'stringB') % logical C_double = double(strcmp(C,'stringB...

4 years ago | 1

| accepted

Answered
How to sum up each data value in 1 txt file?
data = readmatrix('VMF1.BAKO.txt'); odd_rows = data(1:2:end,3); even_rows = data(2:2:end,3); % add each dry element to it...

4 years ago | 0

| accepted

Answered
Is it possible to stop the loop if the output isn't satisfactory and rerun the loop on that given file before running the rest of the loop?
while true % ... % do the greyscale process with the current threshold, % which I assume is the variable thresh ...

4 years ago | 0

| accepted

Answered
How to add rows in between others in a table?
T= [1 2 3 4 ; 6 7 8 9] idx = 2; % insert a single row of zeros at row 2 of T n_cols = size(T,2); T = [T(1:idx-1,:); ze...

4 years ago | 1

Answered
For looping/if statement issue (simple hopefully)
There are a few problems. Problem 1: for c = i tells the loop to iterate once, with the value of c being i. I imagine you mea...

4 years ago | 0

Answered
How to find the index of the first repeating value.
a = [1,2,3,4,5,6,7,8,8,8,8,8,8,8,8,8,8,8,8]; b = linspace(0, 10, length(a)); % plot(a,b) plot(b,a) idx = find(diff(a) ==...

4 years ago | 0

| accepted

Answered
How do I save the output from a for loop to an array?
d = zeros(a,1); for c = 1:a d(c) = input(['Enter the number of lines in loop ', num2str(c),': ']); end

4 years ago | 0

Answered
asking for suggestion to modify a form of result
Is this what you mean? clc clear all close all k=12; m=40; v=k/m; a= 24:1:120; b= 24:1:120; c=24:1:120; d=24:1:120;...

4 years ago | 0

Answered
Drag and drop plot (inset) within another plot?
Try setting 'HitTest','off' for whatever objects you add to the axes. This will allow mouse clicks to pass through to the axes u...

4 years ago | 0

| accepted

Answered
why do I get "Array indices must be positive integers or logical values" for my coding
Look at what you get with str2double on a character vector expressing a function: g = '@(x)sin(x)'; f = str2double(g) Instead...

4 years ago | 0

Answered
How can i manage a wrong input, whitout restart the my script ?
Generally, for this method of gathering user input, you would use a while loop that iterates until the input is valid. Somethin...

4 years ago | 2

| accepted

Answered
Create cell array of column indices of a specific string
% make cell array g g = repmat({repmat({''},40,50)},5,1); % put 7 random 'Latitude's in each cell for ii = 1:5 g{ii}(ran...

4 years ago | 1

| accepted

Answered
I want to replace NaN occurring between two numbers with an average of the two numbers, however, I do not want to touch places where NaNs are continues. poro.mat attached.
load('poro.mat') idx = 1+strfind(isnan(poro.'),[0 1 0]); poro(idx) = (poro(idx-1)+poro(idx+1))/2; disp(poro(idx.'+[-1 0 1...

4 years ago | 0

| accepted

Answered
How to save table (or cell) as file with custom extension?
"writetable (and writecell) do not allow saving with a .in extension." Yes they do, but you must explicitly specify the FileTyp...

4 years ago | 0

| accepted

Answered
How to obtain a matrix from the iterations of a for loop?
Use kron. A=[ 0.2167 0.2467 0.2520 0.2652 0.2661 0.2907 0.3498 0.4211 0.5348 0.5735 0.5242 0.4...

4 years ago | 1

| accepted

Answered
Checking if columns of matrix are equal to some array
Don't return yet, when you find that some particular column of data is not equal to template. You still need to keep checking th...

4 years ago | 3

| accepted

Answered
Reverse filling a array in MATLAB
array_1 = [NaN,NaN,NaN,NaN,NaN,340,133,133,133,NaN,NaN,NaN,145,NaN,NaN,NaN,NaN,78,68,89,NaN,NaN,NaN] array_1 = fillmissing(arra...

4 years ago | 0

| accepted

Answered
If statement working partially
Part of the problem might be the usage of || and &&. In MATLAB, && takes precedence over ||, so an expression like this: x == ...

4 years ago | 1

Answered
Grouping the Elements of the Array
% Taking your example of an array with 17 elements (rather than 897880), data = 1:17; % and you want to group them into groups...

4 years ago | 0

| accepted

Answered
Create Header with write matrix function
Random data and titles: MTR_data = rand(144,4); MTR_titles = {'Put' 'Your' 'Titles' 'Here'}; You can make the data into a cel...

4 years ago | 2

| accepted

Answered
How to remove certain elements in a matrix according to the value of elements in an array
A = [ 5 6 2 1 4 2 7 9 9 5 ] idx = A(:,1) < 5; A(idx,:) = []

4 years ago | 0

| accepted

Answered
How can I get matlab to go through the list "time" and give all the indexes that are between my upper and lower range for "times"
Try this: [time_idx,times_idx] = find(time > lowrange.' & time < upperrange.') % % ^^^^ ...

4 years ago | 0

| accepted

Answered
Finding the maximum two values within one field conditioned on the values in another field
% random data feedback = struct('gains',num2cell(rand(1,8))); disp([feedback.gains]); %separately save gains from Condition A...

4 years ago | 0

| accepted

Answered
recur.m function
This syntax: function y = recur(a,b,n,x,x0,y0); defines the function recur. If you have already defined the function in an m-f...

4 years ago | 0

Load more