Respondida
I would like to write these two lines in only one line
CdeMA([1 end],i,:) = CdeMA([2 end-1],i,:);

alrededor de 4 años hace | 0

| aceptada

Respondida
How do I reduce the number of columns in matrix?
% zh = 600 X 416; double columns_to_remove = [80 109 237]; % specify which columns will be removed from zhs zhs = zh; zhs...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to write values in a single array
Here's a guess at what result you want to see for problem 1: a=[11 23 165 200 213]; a1=de2bi(a,8,'left-msb'); out1=[]; for i...

alrededor de 4 años hace | 0

| aceptada

Respondida
Assigning a list of numbers to their corresponding cells in a mesh
Is something like this what you're after? MidPoint = 4; %number of midpoints ycells = 4; %number of cells on the y edge Mid_y...

alrededor de 4 años hace | 0

| aceptada

Respondida
create a matrix of maximums
% get the maximum value of each column, along with the row it is located in % (if multiple elements in a column are at the same...

alrededor de 4 años hace | 0

| aceptada

Respondida
Storing info of an averaging automated process into an array without extra values
"I was wondering if it is possible for only the averaged values to be included, without all the unnecessary values in the same c...

alrededor de 4 años hace | 1

| aceptada

Respondida
Saving plots in For loop
I think it's because you can't have a colon (:) in a file name.

alrededor de 4 años hace | 1

Respondida
I want MATLAB to identify the overlapping area.
I don't have the image file, but you mention a circle, so I've specified a circle and modified the hexagon grid code to create o...

alrededor de 4 años hace | 0

Respondida
how to clear label area in each if/elseif loop ?
Calling uilabel creates a new label component. Any other label components that already exist are unaffected by the creation of a...

alrededor de 4 años hace | 0

Respondida
How can I output only part of a array?
This may work for you: FileName = 'Evaluation_114_1688.xlsm'; new_name = regexp(FileName, '_([\d_]+\.)', 'tokens', 'once'); ...

alrededor de 4 años hace | 0

Respondida
multiply a 1 by 500 matrix to a 688 by 550 matrix and want to get the result for iteration instead of final value from 1 by 500 matrix!
It's not clear to me whether "all the iterations" means to iterate over the first 5 elements of ait or to iterate over all eleme...

alrededor de 4 años hace | 0

| aceptada

Respondida
How can i find the areas under single parts of a plot?
%Power P=[ 0.6495 0.7393 0.7551 0.7947 0.7974 0.8713 1.0482 1.2621 1.6027 1.7189 1.5710 1.3070 1.4416 1.5684 1.608 1....

alrededor de 4 años hace | 1

| aceptada

Respondida
Plot functions in a for cycle
You can move your plotting code inside the loops if you want to see a plot in each iteration, yes. I see that you're doing subp...

alrededor de 4 años hace | 0

| aceptada

Respondida
how to generate a vector of binary code
Here you go: % a numeric vector of length 10, containing zeros and ones: [zeros(1,4) ones(1,6)] % a logical vector of length ...

alrededor de 4 años hace | 0

Respondida
Deleting the column with zero values and corresponding columns from another matrix
% (1) data setup: % 4 datasets (i.e., matrices) with 1044 rows and 55 columns: M1 = rand(1044,55); M2 = rand(1044,55); M3 ...

alrededor de 4 años hace | 1

| aceptada

Respondida
Any idea on why a particular line of code is not read even in the debugging mode?
Checking whether x and y are each within some constant limits, like you have: if x >= p_x(1) && x <= p_x(2) && y >= p_y(1) && y...

alrededor de 4 años hace | 1

| aceptada

Respondida
Creating time vector using number of samples
Defining t like this: t=0:1/2500:5000-1/2500 is creating a time vector that has samplerate=2500 [2500 samples/second, say] for...

alrededor de 4 años hace | 0

| aceptada

Respondida
how to generate a multiple if-else if statements for n times?
If all the if/elseif blocks have the same structure, which is this: if last_tol1 < 0.90 act_f = act_f + afl_inc1 elseif l...

alrededor de 4 años hace | 0

Respondida
How to label legend of plot
Something like this should work (using random data and using the second line from each plot call in the legend - adjust as neces...

alrededor de 4 años hace | 0

| aceptada

Respondida
Why do I recieve an error when trying to change the Line Width of a plot line?
The Name,Value pairs supported in plot from the Curve Fitting Toolbox (reference) are different than the Name,Value pairs suppor...

alrededor de 4 años hace | 0

| aceptada

Respondida
can't get sequential .exe execution to occur in matlab
Try removing this line (between the for loops): path=cell(1,num_sim); That line has the effect of resetting path to a cell arr...

alrededor de 4 años hace | 1

| aceptada

Respondida
How do I label the bars in my histogram with the function "histogram" ?
% Create random data for the sake of the example data = 10*rand(1,100); % Draw the histogram and return histogram object h ...

alrededor de 4 años hace | 1

| aceptada

Respondida
How to pass from pixel coordinates to real world coordinates?
unzip reticolato_centroids.zip load reticolato_centroids.mat x = -1600:3:1600; %real world coordinate y = -1200:3:1200; %re...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to reorganization all image long z axis
files = dir('*.bmp'); full_file_names = fullfile({files.folder},{files.name}); [~,fn,~] = fileparts(full_file_names); z = s...

alrededor de 4 años hace | 1

| aceptada

Respondida
How to include a new fixed string ('Name') on header and numerical variable (subsequent rows) in a new column, at the beggining, of a existing .csv file?
% show the contents of data.csv type data.csv % the IDs you want to include in the file: IDs = [1314; 1314]; % read the fi...

alrededor de 4 años hace | 0

Respondida
Sequencing a matrix with two constant variables and two incremental variables
Like this? max_num = 10; % change max_num to 100 if you want N to go up to 100 A = reshape(ones(1,max_num-3).'+(0:max_num-3)...

alrededor de 4 años hace | 0

Respondida
Importing multiple text files into MATLAB
The options you have available to you depend on the contents of your txt files, but one general option (i.e., will work regardle...

alrededor de 4 años hace | 0

| aceptada

Respondida
how to padding array with zeros to limit rows (I can choose the limit)
AB=[1 6 2 7 3 8 4 9 5 10]; AB(21,:) = 0; % MATLAB fills the intervening rows with zeros disp(AB);

alrededor de 4 años hace | 1

Respondida
How to plot a function on an existing plot
It seems to work ok. Here I'm using different data for the image because I don't have your txt files. % bandstructure.m (modifi...

alrededor de 4 años hace | 1

| aceptada

Respondida
Create a time array
val = [ ... '17-10-58_086'; ... '17-11-09_923'; ... ] dt = datetime(val,'InputFormat','HH-mm-ss_SSS') dt_diff =...

alrededor de 4 años hace | 0

Cargar más