Community Profile

photo

Benjamin


Last seen: Today Active since 2013

Statistics

All
  • Treasure Hunt Participant
  • Revival Level 4
  • Pro
  • Commenter
  • Leader
  • Knowledgeable Level 4
  • Promoter
  • Scholar
  • 3 Month Streak
  • CUP Challenge Master
  • Introduction to MATLAB Master
  • Community Group Solver

View badges

Content Feed

View by

Answered
Random sized hexagones in a hexagone grid
The problem is here: Rcore = rand(size(Xh))*range(bounds)+bounds(1); R1core = rand(size(Xl))*range(bounds)+bounds(1); Those a...

31 minutes ago | 0

Answered
Error using feval and Invalid function name
You can use an anonymous function, e.g., f = @(x)x/56, or a named function, rather than a character array (f = 'x/56') for feval...

12 hours ago | 0

| accepted

Answered
Stopping a for loop when certain values have been reached
values = []; n_tries = 1000; for i = 1:n_tries values(i) = randi(9); if all(ismember(1:9,values)) break ...

12 hours ago | 0

Answered
how can i split mtrix to three ?
Here is one possible way, if A is your matrix: A1 = A(1:51,:); A2 = A(52:102,:); A3 = A(103:153,:);

12 hours ago | 0

Answered
How do I pass variable from one function to another
How about this? function [v] = Popup(obj, handles , h_listbox) parameters=detectImportOptions('Data.xlsx'); ...

13 hours ago | 0

| accepted

Answered
Why does my graph come out wrong?
x = -10:0.01:10; y = (x.^2-1).^(2/3); plot(x,y) Note the warning about complex values. The values of y where abs(x) < 1 are c...

1 day ago | 0

Answered
circshift function working explanation needed
circshift(s,d) for a vector s and positive integer d shifts the elements of s to the right by d amount, wrapping back to the beg...

1 day ago | 0

| accepted

Answered
Taking averages of only a few rows out of several?
A = (1:6).'.*(1:100) mean(A(1:3,:)) mean(A(1:3,:),'all') mean(A(end-2:end,:)) mean(A(end-2:end,:),'all')

1 day ago | 0

Answered
delete cell and replace with remaining cells in matlab
If you delete elements from an array (of any type including a cell array) from within a for loop that loops over the elements of...

1 day ago | 0

Answered
How do I convert a 3x153 double to a 1x51 matrix?
% Create a 3-by-153 matrix with random data: A = rand(3,153) % Convert the 3-by-153 matrix to a 1-by-51 cell array, with eac...

1 day ago | 0

Answered
How to plot the results below ?
Here is something you can try: close all; clear all; clc %Location of the directory Location = 'F:\3-PIV_Experimental_Data\Ou...

2 days ago | 1

Answered
How to only extract part of the folder name?
Here is one way: folder_name = 'Run 12-27-56.Adaptive PIV.6uqqm6yu'; folder_number = folder_name(find(folder_name == ' ',1)+1:...

2 days ago | 2

Answered
Stract error line 91 and not recognizing the variable
Is something like this what you're trying to do? DataChan1 = importDataChanfile('Data_Chan1.txt'); t=DataChan1{:,1}; % time se...

2 days ago | 1

| accepted

Answered
GUI design according to selection of pop-up
If you used GUIDE then, in the GUI's OpeningFcn, you can call your popupmenu's Callback function or otherwise set the visibility...

2 days ago | 0

Answered
Remove unwanted text from a .txt file
Original code with output: trace = regexp(fileread('trace.txt'),'^(\d+)\.?\d*:[^:]+:\s+([^\n]+)','tokens','lineanchors'); trac...

2 days ago | 0

| accepted

Answered
I can not write piecewise function
sampling=3600; theta_12=linspace(0,2*pi(),sampling+1); T_16 = zeros(1,sampling+1); % idx = theta_12 >= 0 & theta_12 <= 0....

3 days ago | 0

Answered
Horizontal concatenate in UItable table
c = readcell('input.xlsx'); c(1,:) = []; idx = ~cellfun(@ischar,c); c(idx) = cellfun(@num2str,c(idx),'UniformOutput',false) ...

3 days ago | 0

Answered
How to make pairs of 1s and 0s in an array?
close all clear clc m = 5 %amount of 1s k = 13 %length of array n = k-m %amount of 0s % rhythm_0 = [repelem(0,n)] % r...

3 days ago | 0

| accepted

Answered
Find local min point in plot
clear all; clc; Wavelength = xlsread('Calcite.xlsx','A6:A2156'); reflection = xlsread('Calcite.xlsx','B6:B2156'); % lmin=i...

3 days ago | 0

Answered
Generate new file w/ each iteration of for loop. Problem of same output in each new file?
thissample = xlsread('~/Documents/mdd_with_anx.xls'); thissample_size = size(thissample,1); N = 100; if thissample_size < N ...

3 days ago | 0

Answered
Time arithmetic (no dates)
datetime(0,0,0,4,30,0) - datetime(0,0,0,2,45,0)

3 days ago | 2

Answered
to form a helix spiral
clc R=30; %% radius of curvature W=0.0125; %% width of grating r=10; %% radius of workpiece th_1=(asin(W/R)); %% angle at w...

4 days ago | 0

| accepted

Answered
Load and plot .mat file
x = load('signal1.mat') y = load('signal2.mat') plot(x.x,y.x,'.')

4 days ago | 0

Answered
ylim error "Array indices must be positive integers or logical values"
You have a variable called ylim, so the instruction ylim([0 5]) means to get the elements in ylim at index 0 and index 5, which ...

4 days ago | 0

| accepted

Answered
Place data within a cell in rows
The attached function may be of some use. t = table(["t = -3.66 p = 0.001 x, y, z = -26.1, -6.2, 52.2 Nvx = 31"; "t = -4.66 p...

4 days ago | 0

Answered
How to find the corresponding points of interest on a lat/lon matrix?
S = load('data.mat'); [~,ridx] = ismember(S.updownLon,S.lonMat(:,1)); [~,cidx] = ismember(S.updownLat,S.latMat(1,:)); [n,...

4 days ago | 0

| accepted

Answered
reorder on a plot
% Generate random data. In order to be able to distinguish the boxes, make % UpRight have mean 0, DownRight have mean 1, DownLe...

4 days ago | 0

| accepted

Answered
Remove Black pixels and averaging the pixels
This will average the non-black pixel values in each channel independently: data = imread('https://www.mathworks.com/matlabcent...

4 days ago | 0

| accepted

Answered
check if numeric field is empty in app designer
Try changing line 117 of app2 (/CurvePlotDropDownValueChanged) to: xlim(app.UIAxes,[app.xMin app.xMax]); Note the xMax was fir...

4 days ago | 0

Answered
How to replace specific values with 0's
A = rand(1435,205); B = A(316:351,146:150) % 36-by-5 sum(B(:)) or: sum(sum(A(316:351,146:150))) or: sum(A(316:351,146:150)...

4 days ago | 0

| accepted

Load more