Respondida
How to plot three different colored groups of log plots (5 lines, 5 lines, 2 lines) on the same axes?
You should provied the same number of legends. Something like, legend ('show','0-3m (1)','0-3m (2)','0-3m (3)','0-3m (4)','...

más de 8 años hace | 0

Respondida
i want to code such that the loop is constraint for two different values?
N = 108300; x = rand(N,1); sum_rows = 300; l1 = x(1:sum_rows:N); %take every 300th value l1_r = reshape(repmat(l1...

más de 8 años hace | 0

| aceptada

Resuelto


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

más de 8 años hace

Resuelto


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

más de 8 años hace

Resuelto


Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

más de 8 años hace

Respondida
How can I end a for loop when a specific value is reached and create a new array with data that meets that condition?
If I understand correctly, you want to compare |meanr2| with the mean calculated from |ruber| but you're actually comparing it w...

más de 8 años hace | 0

Respondida
How to use two different color schemes in one bar chart?
figure wi=1; ax1 = subplot(2,1,1); bar(Y, wi); colormap(ax1,cool) legend('One','Two', 'Three'); ax2 = s...

más de 8 años hace | 0

| aceptada

Respondida
How to make a break on the x axis?
plot(rand(150,1)) xticks([0 100 120 150])

más de 8 años hace | 0

Respondida
format the x-axis in a boxplot
set(gca,'FontAngle', 'italic') %for italics set(gca,'XTickLabel',{'$$a3_{1}$$','$$a3_{2}$$'}); %for...

más de 8 años hace | 0

Respondida
How do I run a matlab script automatically from an excel input?
There's nothing you can do inside Matlab to do this. Anyway, you should do it with a batch file and hyperlink that file on your ...

más de 8 años hace | 0

Respondida
When I am plotting figure in matlab with many legend entries, the legend box is covering my plot area and making some plots invisible.I tried using 'Orientation','Horizontal',but it spreads out to a larger row.Can anyone help me to resolve issue?
legend('Location','northoutside','Orientation','horizontal') I guess you might also want to fold it into two lines as shown...

más de 8 años hace | 0

| aceptada

Respondida
How can find a same values in another matrix and copy the row
ind = arrayfun(@(y) find(B(:,1)==y),A(:,1)) CC = [A B(ind,:)]

más de 8 años hace | 1

| aceptada

Respondida
How to look for minimum value in a vector from backwards?
find(A==A_min,1,'last')

más de 8 años hace | 0

Respondida
How can I insert an image when publishing a document?
% <<yourFile.jpg>> Make sure to save your image in the folder where your m-file is being published. More <https://de.mathwo...

más de 8 años hace | 0

Respondida
How to get variables needed for Simulink model?
filename = 'yourMatfile.mat'; yourVariables = {'X','caption'}; S = load(filename,yourVariables{:})

más de 8 años hace | 0

Respondida
how to update filename in a call to an external application ?
Hi Hans Jørgen Jensen , I've tried your code and yeah, I see your problem. I don't understand it but probably you could simpl...

más de 8 años hace | 0

| aceptada

Respondida
How Can I add a data to a Stateflow as an input data?
check this <https://de.mathworks.com/help/simulink/slref/fromworkspace.html>

más de 8 años hace | 0

Respondida
Average timestamp 20 seconds interval data into hourly
dt = datetime('01.01.2015 00:00:00'):seconds(20):datetime('01.01.2015 05:00:00'); val = rand(901,1); TT = timetable(dt',...

más de 8 años hace | 0

Respondida
How do i Filter out table columns headers based on given query words?
x = rand(3,3); rowX = {'A1','A2','A3'}; xT = array2table(x,'RowNames',rowX) xA1 = table2cell(xT({'A1'},:))

más de 8 años hace | 0

Respondida
How do calculate the summation of every row in the given table?
yourTable.Sum = sum(yourTable{:,2:end},2);

más de 8 años hace | 4

| aceptada

Respondida
how to naming files sequently?
prefix = 'TOTL_REDC_2017_07_'; days = {'02_','03_'}; hours = {'0500','0600'}; fileNames = cellfun(@(d,h) [prefix d h]...

más de 8 años hace | 0

Respondida
30-day running mean from hourly data
dt = datetime([Yrly_slr(:,1:4) zeros(length(Yrly_slr),2)]); TT = timetable(dt,Yrly_slr(:,5)); TT2 = retime(TT,'monthly',...

más de 8 años hace | 1

| aceptada

Respondida
while condition to test numeric
t = 1; while t powerInput = input('Please enter the power input, number only and between 35kW and 45kW: '); i...

más de 8 años hace | 0

Respondida
Extracting elements from a matrix based on the maximum position in another matrix
arrayfun(@(j,f) A(j,f), J,1:size(A,2))

más de 8 años hace | 0

| aceptada

Respondida
How small a number has to be to be "equal" to zero?
realmin

más de 8 años hace | 0

Respondida
how to open datafiles with an exe-file
!your_program.exe your_file

más de 8 años hace | 0

| aceptada

Resuelto


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

más de 8 años hace

Respondida
Stacking plots using subplot
figure subplot(3,1,1) %subplot(rows,coloumns,current_axis) subplot(3,1,2) subplot(3,1,3)

más de 8 años hace | 0

| aceptada

Resuelto


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

más de 8 años hace

Cargar más