Answered
Readtable, problems reading identically structured data files
If you are not specific on to use only table try this f1 = fopen('File1.txt', 'r'); f2 = fopen('File2.txt', 'r'); % read file...

6 years ago | 0

| accepted

Answered
Removing an empty 1st row from a UITABLE (cell array)
d = d(~cellfun(@isempty, d))';

6 years ago | 0

| accepted

Answered
How can I make a for loop a while loop?
x57a= []; i = 1; while i<= 1000 if rem(i,5) ==0 || rem(i,7) ==0 if rem(i,5)==0 && rem(i,7) ==0 i...

6 years ago | 0

| accepted

Answered
strrep for unordered string
What about reguler expression? result = regexprep('Z06IL202RNP302', '(Z|IL|RNP)', '');

6 years ago | 0

| accepted

Answered
Comparing Two Different Arrays
X = B>min(A) & B<max(A);

6 years ago | 1

| accepted

Answered
How to export cell array to excel
A = {'matlab' 'ver' num2str(12)}; % actually no need of number to string conversion writecell(A, 'filemname.xlsx');

6 years ago | 0

| accepted

Answered
I need to create a 1x6 string combining strings?
Use + operator for string data type concatanation X = space+ L+ space+ J+ space+ I+ space+ C; % this works for you

6 years ago | 0

Answered
Vector averaging with mean command
Second argument of mean is dimension, your input vector X is 1x533 vector 1D vector. 1) I assume you need mean of the values f...

6 years ago | 0

Answered
Hi, i'm having trouble reading multiple excel files in a loop and performing simple calculation of the mean for a specific column
readtable is better than readmatrix here folder_path = 'C:\Users\rebec\Desktop\loop'; % your path num_files = 3; % number...

6 years ago | 0

| accepted

Answered
working with files, changing in the text
data = fileread('kik.txt'); % your text file data rep_data = regexprep(data, '[789]', '!'); % replaced data fid = fopen(...

6 years ago | 0

Answered
how to extract number from a .dat file and assign it to an excel sheet cell?
Assuming your a.dat file is with data "Surface Integral Report" Average of Surface Vertex Values ...

6 years ago | 0

| accepted

Answered
Multiply a scalar to all column of a table
Suppose T is your table variable with it's variable name Var1 T.Var1 = 10*T.Var1;

6 years ago | 1

| accepted

Answered
Probability, Statistics, and Applications in BME
data_500 = rand(1, 500); % 500 random values values_40 = randperm(500, 40); % 40 random values(...

6 years ago | 0

Answered
Count Occurrences of a Variable from Excel per Chronological Date
t= readtable('SS.xls'); % read as table t.S1 = single(strcmp(t.ComplaintLocation, 'S1')); t.S2 = single(strcmp(t.ComplaintLoca...

6 years ago | 0

| accepted

Answered
Variable Number of Input Arguments
You need provide two inputs but you have provided only one input 20. Give inputs functions as age and limit [too_young] = un...

6 years ago | 0

Answered
how to take a certain number of characters:
num_str = num2str(9928900200); first_part = num_str(1:6); second_part = num_str(7:end); num = strcat(first_part, ',', sec...

6 years ago | 0

Answered
Could anyone help me to count the number of elements present in each row are different.
result = cellfun(@(x,y)strcmp(x,y), A, B)/numel(A);

6 years ago | 0

Answered
Formatting .txt files as the one produced by command prompt.
You can include same input to system command sts = system('tasklist.exe > %USERPROFILE%\Desktop\processlog.txt'); This works a...

6 years ago | 1

Answered
Plotting two .m files on one graph
Maintain same figure value in both files. suppose file_1.m figure(1) % figure 1 plot(1:100) hold on file_2.m figure(1) ...

6 years ago | 0

Answered
How to Convert xls file to txt file in matlab?
Read ExcelFile.xls data and write that data to text file Data = readtable('ExcelFile.xls'); writetable(Data, 'textfile.txt');

6 years ago | 1

| accepted

Answered
division of consecutive numbers
y = randi(100, 1, 120); % assumed data of length 120 for ii = 1:4:length(y) values_4 = y(ii:ii+3); % fou if mean(val...

6 years ago | 1

| accepted

Answered
Command to delete last row and column of a matrix
your_matrix(end, :) = []; % deletes your matrix end(last) row your_matrix(:, end) = []; % deletes your matrix end(last)...

6 years ago | 0

Answered
Calculating the mean of a non-continuous data set
mean_val = nanmean(your_variable)

6 years ago | 0

| accepted

Answered
Question on using interpolate function
"I want to find the x value at which data has 0.4 (first occurence)." match_loc = find(data == 0.4); val = x(x == match_loc(1)...

6 years ago | 0

Answered
extraction of part of image
im = imread('peppers.png'); % read image res_image = uint8(im>200).*im; % apply your condition figure, imashow(res_image);...

6 years ago | 0

Answered
how to defining date format ?
d_vect = datetime('2007.01.01. 01', 'Format', 'yyyy.MM.DD. HH');

6 years ago | 0

| accepted

Answered
plot graph for nested if
l=input('l='); g = zeros(1, length(0:100));% initialize g with 0's of length t c = 1; % counter variable for t=0:100 if...

6 years ago | 0

| accepted

Answered
another way to break without using the command 'break'
You can set a flag variable to terminate while loop without using break keyword term_while = true; % flag variable c = 0...

6 years ago | 0

Answered
Given a table, how can I delete rows not satisfying a certain property?
Assuming t is your table variable and variable names are col_1 and col_2, cond = (35>t.col_1 & t.col_1<40)&(20>t.col_2 & t.col_...

6 years ago | 0

| accepted

Load more