Community Profile Benjamin

Last seen: Today Active since 2013

Statistics

All
• • • • • • • • • • • • Content Feed

View by

How do I pass variable from one function to another

42 minutos ago | 0

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...

alrededor de 18 horas ago | 0

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...

alrededor de 18 horas ago | 0

| accepted

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')

alrededor de 22 horas ago | 0

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 día ago | 0

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 día ago | 0

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 días ago | 1

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 días ago | 2

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 días ago | 1

| accepted

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 días ago | 0

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

2 días ago | 0

| accepted

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....

2 días ago | 0

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

3 días ago | 0

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 días ago | 0

| accepted

Find local min point in plot

3 días ago | 0

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 días ago | 0

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

3 días ago | 2

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...

3 días ago | 0

| accepted

3 días ago | 0

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 ...

3 días ago | 0

| accepted

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...

3 días ago | 0

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 días ago | 0

| accepted

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 días ago | 0

| accepted

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 días ago | 0

| accepted

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 días ago | 0

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 días ago | 0

| accepted

i know the scale but when i use imagesc function the image doesnt show me the right size of my spot. what am i doing wrong?
imagesc() is for scaling the colors in an image. It sounds more like you want to resize the image. imshow(imresize(PhaseDat...

7 días ago | 0

The image can't be excuted using Imshow function
Is this file: C:\Users\ali.sina\OneDrive - Nude Solutions\Documents\MATLAB\image.m a file you wrote? If so, rename it so that ...

7 días ago | 0

For loop for string elements and data on a column
%Free Fall clear, clc planet = ["Mercury", "Venus", "Earth", "Moon", "Mars", "Jupiter", "Saturn",... "Uranus", "Neptune",...

7 días ago | 0

| accepted