답변 있음
Extract text from .txt file, paste in excel
Maybe something like this: folder = '/Documents/MRI_data/FM/'; N_files = 60; N_rows = 800; str = compose('MNP_%03d',1:N_file...

대략 3년 전 | 0

답변 있음
How do I add a flat line on the z-axis?
[x,y]=meshgrid(0:0.0001:0.004,-pi/4:0.1:pi/4); c=cos(y).*sqrt(pi.*x); d=cos(y).^2; e=sin(y).^2; KI2=0.78^2; KII2=1.47^2; f...

대략 3년 전 | 0

| 수락됨

답변 있음
Color Coding Data Points Using Scatter
% random data T = [10 25 40 50 75]; alldataoxides = struct( ... 'pHs',3+9*rand(1,100), ... 'kds',80*rand(1,100), ......

대략 3년 전 | 0

답변 있음
How can I fix value of vector inside for loop ?
angles = [ 20 45 60 30 90]; randomize_angles=randperm(numel(angles)); selection_made = false; for i=1:numel(randomi...

대략 3년 전 | 0

답변 있음
Table cells and arrays getters
% get the data myMat = cat(3,t.field2{:});

대략 3년 전 | 0

| 수락됨

답변 있음
how to pause and continue running a for loop
Here's a simple GUI with an animated line. The for loop adds one random point to the line in each iteration. The button can be u...

대략 3년 전 | 0

답변 있음
why am i getting this message: "Array indices must be positive integers or logical values."?
min = df(:,2); That line makes min a variable. Then when you try to take min(long_deg) on the error line, MATLAB interpre...

대략 3년 전 | 0

답변 있음
What does a = b+c ~= d/e mean?
a = b+c ~= d/e; for scalars b, c, d, and e, is the same as if b+c ~= d/e a = true; else a = false...

대략 3년 전 | 0

| 수락됨

답변 있음
my error when i wrote that x*x or x^2 is not working
Maybe this: n=1:100; n_true = []; for i=1:length(n) x = 2:n(i)-1; x2 = mod(x.^2,n(i)); if ~any(x2 == x) ...

대략 3년 전 | 0

| 수락됨

답변 있음
How to split characters of a cell/string in matlab?
g='CHARLES'; C = cellstr([g(1:end-1); g(2:end)].').'

대략 3년 전 | 0

| 수락됨

답변 있음
Replacing One Character Issue
"I want to replace the 1st character with a $" picture = '% % %'; disp(picture) picture(1) = '$'; disp(picture) Note that t...

대략 3년 전 | 0

답변 있음
Color map using gscatter
% some made-up data alldataoxides = struct( ... 'pHs',14*rand(1,100), ... 'kds',1000*rand(1,100), ... 'Temperatu...

대략 3년 전 | 1

| 수락됨

답변 있음
uiresume not working in function.
Callbacks specified as character vectors (as in "'uiresume(fig)'") execute in the base workspace, so when the Continue button is...

대략 3년 전 | 1

| 수락됨

답변 있음
Insert/Concatenate cell array into nested cell array (by column and repeat in each row)
load SampleData CA{:} % original AA = repmat(A,size(CA{1},1),1); BB = repmat(B,size(CA{2},1),1); CC = repmat(C,size(CA{3},...

대략 3년 전 | 0

| 수락됨

답변 있음
How can I correct this code so that it breaks out of the loop when x is equal to one of the options in the x~=
j=randi([1 20],1); i=randi([1 20],1) ; x=[i,j]; stop = [1,10;10,1;2,9;9,2;3,8;8,3;4,7;7,4;6,15;15,6;7,14;14,7;8,13;13,8;9,1...

대략 3년 전 | 0

| 수락됨

답변 있음
In a cell array (which contains num. vectors of different lengths [ex.1x159871]), pad the ends of each cell with 'NaN' according to the longest row [ex. 1x249359]
Here's that same example, but each cell contains a row vector: % the data A = {rand(1,47),rand(1,80),rand(1,97)}; % pad wit...

대략 3년 전 | 0

| 수락됨

답변 있음
How change the color of text bar like the color of the bar ?
data = rand(4,4); data(:,[3 4]) = 0; Bar = bar(data); [m,n] = size(data); ctr = zeros(n,m); ydt = zeros(n,m); for k1 = 1...

대략 3년 전 | 0

답변 있음
I am trying to find the row and or column of a value in an imported text file
M = [1 8 9 13 2 5 9 15 5 8 2 3]; [r,c] = find(M==13)

대략 3년 전 | 0

답변 있음
Assign a set of weights to digits
load('counts.mat') disp(counts); [mm,nn] = size(counts); weights = zeros(mm,nn); for kk = 1:mm [~,ii,jj] = unique(count...

대략 3년 전 | 0

| 수락됨

답변 있음
Trying to calculate the outputs for this equation in a for loop, but it only calculates for one input; when g = 1.67
M = 2; g = linspace(1,1.67,4)'; beta_max = zeros(size(g)); for i = 1:length(g) beta_max(i) = asind((g(i)+1)./(4*g(i))-1....

대략 3년 전 | 0

답변 있음
How can I swap two values in a sequence and create a new sequence
S = 'AABBBBCCDDD'; A = S(randperm(length(S))) idx_firstA = find(A == 'A',1,'first'); idx_lastD = find(A == 'D',1,'last'); ...

대략 3년 전 | 0

| 수락됨

답변 있음
How do I organize my code so it works?
"Code to call your function" should be something like: in_vector = [0,0,1,2,3]; num_of_digits = count_digits(in_vector);...

대략 3년 전 | 0

답변 있음
How to list all tasks in a table and sum up total time spend on each?
Note that the start_time* and end_time* columns in task_table are fractions of a day: % list of tasks to calculate total hours ...

대략 3년 전 | 1

| 수락됨

답변 있음
I get this error when I try to solve - "This statement is not inside any function." I am started to coding so please help
In a script, any function definitions need to be at the end: % Define the initial conditions and time vector y0 = [1; 0; 0; 1]...

대략 3년 전 | 0

답변 있음
How can I average from number of zero values separated by NaN values?
input= [ 0 0 0 0 0 NaN NaN NaN 0 0 0 NaN NaN 0 0 NaN NaN NaN 0 0 ...

대략 3년 전 | 0

| 수락됨

답변 있음
Updating Edit Field Text Through Runtime of Code in App Designer
Notice the pause(1) after app.EditField.Value = 'Grabbing Data';. That pauses execution for 1 second, which is "enough time for ...

대략 3년 전 | 0

| 수락됨

답변 있음
Start plot at origin
data1 = gnegate(d(:,3)); data2 = r; data1_plot = data1 - data1(1); data2_plot = data2 - data2(1); plot(tv,data1_plot,'r'...

대략 3년 전 | 0

| 수락됨

답변 있음
how to code equation
Nu = (0.032.*(Pr).^(1/3)).*((rho.*Uinf.*x/mu).^(1/2)).*(1 -(x0/x).^(3/4).^(-1/3); % ...

대략 3년 전 | 0

| 수락됨

답변 있음
Trying to make 2 data sets the same length
If you want to "expand" the shorter dataset to match the length of the longer one using interp1, here's one way: dataset1 = ran...

대략 3년 전 | 1

답변 있음
How can I run these codes in a for loop?
If the means are all scalars m = zeros(5,1); for ii = 1:5 idx = hour(result.HourSeries1) == ii-1; m(ii) = mean(Clima...

대략 3년 전 | 1

| 수락됨

더 보기