Statistics
RANK
26
of 257,813
REPUTATION
7,014
CONTRIBUTIONS
54 Questions
2,335 Answers
ANSWER ACCEPTANCE
53.7%
VOTES RECEIVED
1,191
RANK
2,243 of 17,766
REPUTATION
716
AVERAGE RATING
4.90
CONTRIBUTIONS
5 Files
DOWNLOADS
24
ALL TIME DOWNLOADS
5291
CONTRIBUTIONS
0 Posts
CONTRIBUTIONS
0 Public Channels
AVERAGE RATING
CONTRIBUTIONS
0 Highlights
AVERAGE NO. OF LIKES
Content Feed
Is it possible to rename columns in a table?
You can rename the variables in a table by using either the "Properties.VariableNames" property or the "renamevars" function. (I...
22 days ago | 33
| accepted
Separating data into one-second intervals, and finding the maximum data in each interval
%% load data num = load('Green6000X.csv'); %% split data into chunks of one second N = ceil( num(end,1) ); chunk = cell( ...
29 days ago | 0
| accepted
Extract files with the same names in subfolders and save them into a new folder with a different name
%% myFolder = 'current folder path'; filePattern = fullfile(myFolder,'**','*.png'); theFiles = dir(filePattern); numFiles ...
1 month ago | 0
| accepted
comparison of two column vectors
An example %% v1 = rand( 6,1 ); v2 = rand( 6,1 ); %% v1 > v2 This result tells us that the first, fourth, fifth and sixth ...
1 month ago | 0
How to set the value of a variable in one function from another?
Modify the function so that f1 takes n as an input argument function [n,x,y] = f1( n ) n; //code that does stuff with n end ...
1 month ago | 0
| accepted
Error with readtable function
I assume that the entire text file and the result fits in your RAM. "huge" means different things to different people. This fun...
2 months ago | 0
| accepted
How to delete the words/characters from a .txt file?
Another way. See documentation on textscan(), formatSpec — Format of the data fields fid = fopen( 'loadcell_data.txt' ); cac ...
2 months ago | 2
How do you vertically concatenate the rows of a cell array consisting of vectors of numbers?
Example m = magic(3); m = [m,m,m]; cac = num2cell(m); % sample data arrayfun( @(ix) vertcat(cac{:,ix}), [1:9], 'uni',false ...
2 months ago | 0
| accepted
Help with the below error
Example A = 17; % A is a scalar A(2) % there is no element with index 2
2 months ago | 1
| accepted
MATLAB Answers Wish-list #5 (and bug reports)
I noticed a minor issue with hyperlink. Clicking the link (marked with yellow below) in my Content Feed takes me to the wrong ...
2 months ago | 0
Why do I get invalid expression error for this piece of code?
Missing comma and a semicolon % disp(['The number of days between bdate,'and, 'edate'; leapyr]); % % ...
2 months ago | 1
How to subtract contents of cells in cell array?
The problem is that baskets_xyz is a cell array of cell arrays. Your cellfun statements requires a cell array of double (numeric...
3 months ago | 0
| accepted
Class : Error while assigning variables in constructor
How did you call the constructor? I added a few line to make your code a syntactically correct class. And tested the constructo...
3 months ago | 0
How to add header to cell matrix
No, however that depends on what you require from the "header". Is this useful? If not see table - Table array with named variab...
3 months ago | 0
| accepted
MATLAB Answers Wish-list #5 (and bug reports)
A minor issue By mistake I accepted an old question of mine. I realized my mistake an unaccepted the question. However, in my "...
4 months ago | 1
Class method is 'call by value' function, isn't it?
See Comparison of Handle and Value Classes. Your myClass is a value class. "It tells me that first input arg must be instance...
4 months ago | 0
Class property automatically propagated to old class instances
See Comparison of Handle and Value Classes Your exampleClass is a value class. However, the behavior you describe is more like ...
4 months ago | 0
| accepted
Index in position 1 exceeds array bounds. Index must not exceed 1.
What is your intention with this assignment? %% Initial condition T(:,:) = 293; % initial temperature (K) Matlab mak...
4 months ago | 0
Run a large number of iterations without the use of a for loop
Preallocating the variable t will improve speed a lot. Something like t = nan( 1536256, 1 ); t(1) = rf-r0; ... t(i) = rf-...
4 months ago | 1
How to vectorize the function?
Read Array vs. Matrix Operations. With scalars the two produce the same result, but not with vectors and arrays. The second se...
6 months ago | 1
| accepted
How am I suppose to fix this error. I am trying to run the code in order to get a stress vs strain plot and find the value described in the script.
This script runs without throwing errors; the syntax is correct. I assigned values to some undefined variables, lo, m, x, y. C...
6 months ago | 0
| accepted
Extracting the numeric part from a cell
Try >> extractBetween( "injection-0:94582)", ":", ")" ) ans = "94582"
6 months ago | 1
'line' returns number instead of handle inside a loop of a class method
I have reproduced your findings on R2018b. The numerical "handles" are the old type, pre R2014b. I failed to find an explanati...
6 months ago | 0
Error using for loop to delete empty cell array elements
Replace for i=1:numel(temp_routes_log) by for i = numel(temp_routes_log) : -1 : 1 % loop from last to first element OR if r...
7 months ago | 0
| accepted
how to find the immediate date before in one column based on another column using find function?
Assumptions: the two column vectors are sorted a specific date in the first vector may exist in the second vector more than o...
7 months ago | 0
| accepted
Whitespace Delimited Textfile, NaN results?
The problem is caused by 'Delimiter',' ' in datacell = textscan(fid,'%f%f%f%f', 'Delimiter',' ', 'CollectOutput', 1); in co...
7 months ago | 1
| accepted
empty array size is stuck on 1x3
Try replace fscanf(fileID,'\n\n\n\n\n\n\n\n\n\n\n\n\n\n'); by for jj = 1 : 14 fgetl( fileID ); end fscanf(fileID,'\n\n...
7 months ago | 0
Please help me to look at the code. Thx
This returns a numerical result, but it's not an integer. fun = @(x) exp(-x.^2./2); int = gausslegendre( 0, 2, fun, 1 ) func...
7 months ago | 0
| accepted
I have an invalid use of operator error
I have modified your function to avoid the recursive call of the function. atmos function [T,p,rho] = atmos() h = 0:0.2:20...
7 months ago | 1
| accepted
Trouble using the system command with special characters
You try to call system() with a sequence of several input arguments and assumes that system() shall join these arguments to the ...
7 months ago | 0