Réponse apportée
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)','...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

A résolu


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

plus de 8 ans il y a

A résolu


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

plus de 8 ans il y a

A résolu


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

plus de 8 ans il y a

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
How to make a break on the x axis?
plot(rand(150,1)) xticks([0 100 120 150])

plus de 8 ans il y a | 0

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

plus de 8 ans il y a | 0

Réponse apportée
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 ...

plus de 8 ans il y a | 0

Réponse apportée
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...

presque 9 ans il y a | 0

| A accepté

Réponse apportée
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,:)]

presque 9 ans il y a | 1

| A accepté

Réponse apportée
How to look for minimum value in a vector from backwards?
find(A==A_min,1,'last')

presque 9 ans il y a | 0

Réponse apportée
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...

presque 9 ans il y a | 0

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

presque 9 ans il y a | 0

Réponse apportée
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...

presque 9 ans il y a | 0

| A accepté

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

presque 9 ans il y a | 0

Réponse apportée
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',...

presque 9 ans il y a | 0

Réponse apportée
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'},:))

presque 9 ans il y a | 0

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

presque 9 ans il y a | 4

| A accepté

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

presque 9 ans il y a | 0

Réponse apportée
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',...

presque 9 ans il y a | 1

| A accepté

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

presque 9 ans il y a | 0

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

presque 9 ans il y a | 0

| A accepté

Réponse apportée
How small a number has to be to be "equal" to zero?
realmin

presque 9 ans il y a | 0

Réponse apportée
how to open datafiles with an exe-file
!your_program.exe your_file

presque 9 ans il y a | 0

| A accepté

A résolu


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

presque 9 ans il y a

Réponse apportée
Stacking plots using subplot
figure subplot(3,1,1) %subplot(rows,coloumns,current_axis) subplot(3,1,2) subplot(3,1,3)

presque 9 ans il y a | 0

| A accepté

A résolu


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

presque 9 ans il y a

Charger plus