Beantwortet
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)','...

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

| akzeptiert

Gelöst


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

fast 9 Jahre vor

Gelöst


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

fast 9 Jahre vor

Gelöst


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

fast 9 Jahre vor

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

| akzeptiert

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

| akzeptiert

Beantwortet
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,:)]

fast 9 Jahre vor | 1

| akzeptiert

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

| akzeptiert

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

fast 9 Jahre vor | 0

Beantwortet
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',...

fast 9 Jahre vor | 0

Beantwortet
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'},:))

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 4

| akzeptiert

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

fast 9 Jahre vor | 0

Beantwortet
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',...

fast 9 Jahre vor | 1

| akzeptiert

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

| akzeptiert

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

| akzeptiert

Gelöst


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

fast 9 Jahre vor

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

fast 9 Jahre vor | 0

| akzeptiert

Gelöst


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

fast 9 Jahre vor

Mehr laden