Multiplying an entire table by a column from another table.
t1 = table; t2 = table; % table t1 t1.a = rand(10,1); t1.b = rand(10,1); % table t2 t2.c = rand(10, 1); %processed_data ...

4 years ago | 0

pick elements from an array
new_a = a(a>=0.5 & a<=0.8);

4 years ago | 0

Question

Validate and get exact number of characters using the regular expression
Hi all, I am using MATLAB R2016a version and working on a chacters set like str = 'ENGINE-45'; % this is okay(digits are 2 a...

4 years ago | 2 answers | 0

### 2

How to use unique function here
inn_A = [A{:}]; str_A = cellfun(@(x)num2str(x(:)'),inn_A,'UniformOutput',false); [~,idx,idx2] = unique(str_A); Result = inn_A...

4 years ago | 0

| accepted

I want to plot the Point directly on the highest point of the graph
[MaxPower, MaxPow_loc] = max(Power); % then apply hold on; plot(MaxPow_loc,MaxPower,'or','MarkerFaceColor', 'r', 'MarkerSize'...

4 years ago | 0

| accepted

Combine two column vectors when importing data from .csv into one
f = fopen('your file name.csv', 'r') % data = textscan(f, '%s'); fclose(f); your_data = cellfun(@str2num, strrep(data{1}, ...

4 years ago | 0

skip legend entries in property editor?
ax = gca; ax_data = ax.Children; legend(ax_data(1:5), fliplr(ax.Legend.String(9:end)))

4 years ago | 0

How to create a specific Matrix
M = repelem([1:3]', 2, 4)

4 years ago | 0

Save a non scalar struct
Here the MATLAB variable scope and life time plays. For each iteration of for loop calling in the function fun variable ss is n...

4 years ago | 0

How to run script without MATLAB asking to press any key to continue
Remove pause MATLAB commad from your script

4 years ago | 0

How would i extract ONLY even numbered elements of an image?
Part ii % for even values even_values = imgroup1(mod(imgroup1, 2) == 0); % for display purpose evens = imgroup1.*uint8(mod(i...

4 years ago | 0

| accepted

how to get/extract x,y values from scatter function
You need to apply thresholding to the 3rd column of the x variable upto blue colour as it is normalized colour. If you apply co...

4 years ago | 1

| accepted

How to save indices of a certain region of a matrix
ind = find(ismember(A(:), B(:)))

4 years ago | 1

how to extract one variable elements from a function
[~, ~, E]=GenEllResidue(a,b,n); For more details read https://in.mathworks.com/help/matlab/matlab_prog/ignore-function-inputs...

4 years ago | 0

| accepted

Renames a lot of files in directory
fileTo = sprintf('Flight 1000%d.mat',kk);

4 years ago | 0

Convert cell array into array
result = cellfun(@vertcat, vertcat(your_array{:}))

4 years ago | 0

| accepted

equally spaced array of complex numbers
>> [-2:0.01:2]*1i

4 years ago | 0

| accepted

How to save data from every file in a folder
It is not recommended to create table in loop, get the data in variable(say cell data) then form table out of the loop folderDa...

4 years ago | 0

| accepted

Simplest way to save a vector to a variable with commas and braces
You can't save the variable data like that but you can store as in string format a = '[1, 2, 3, 4, 5]' save matfile a load ma...

4 years ago | 0

How to filter winter months
Do you mean to get the time values between 1 to 4 and 10 to 12 (winter )? if yes x = 1:12; data = x(x >= 1 & x <= 4 | x>9 & x<...

4 years ago | 0

| accepted

how to calculate the average of two values data that side by side and place it between those two values
mn = movmean(A, 2, 'Endpoints','discard'); Result = zeros(1, length(A)+length(mn)); Result(1:2:end) = A; Result(2:2:end) = mn...

4 years ago | 0

| accepted

Error reading through all images in a directory
currentImage = fullfile(imageList(k).folder, imageList(k).name);

4 years ago | 0

| accepted

Read every netcdf files in a folder
Try this with full path filename folderData = 'D:\Valerio\data\TEST'; filePattern = fullfile(folderData, '*.nc'); ncfiles = ...

4 years ago | 0

| accepted

Find/Match index of variable from an array
zq = find(b == a)

4 years ago | 2

| accepted

how can I use mean for cell arrays within cell
result = cellfun(@(x)mean(x, 'omitnan'), [T_mon{:}])

4 years ago | 0

Colormap for multline plot
"A colormap is matrix of values between 0 and 1 that define the colors for graphics objects such as surface, image, and patch ob...

4 years ago | 0

| accepted

How do I read in a text file (CREATED FROM BINARY IMAGE OF ROWS-420 AND COLUMNS 680) and sort it by a ROW
x = logical(randi([0,1], 420, 680 )); % assumed that x is your extracted data from the text file x_sorted = sort(x, 2); % s...

4 years ago | 0

| accepted

fid =fopen returns -1 when creating a new file
You forgot the coma fid=fopen('pressure_output.txt','w'); For more details read https://in.mathworks.com/help/matlab/ref/fope...

4 years ago | 0

| accepted