Beantwortet
how to solve extra text error when reading json files?
% I had to change the extension to upload the file, so here I change it back: movefile('test1.txt','test1.json') Try this: tx...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
Delete rows from a table below a certain threshold
% Example Time, Data and T: Time = (1:10).'; Data = rand(10,1); T = 0.5; % Your code, modified: Table = cat(2,Time,Data) ...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
scatterplot for matrix output
M = 2*rand(40,46)-1; % random residuals -1 to 1 ages = 50:95; years = 1980:2019; [A,Y] = meshgrid(ages,years); idx = M >...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Export variables from excel based on a defined column category and time
Something like this would work, if the exact times you're looking for (i.e., every 1 minute starting at an event, until the next...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
How can I plot this kind of graph with variable sample bins?
Maybe it is a histogram2 plot with 'DisplayStyle' 'tile'. histogram2(randn(1e6,1),randn(1e6,1),'DisplayStyle','tile') colorbar...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
how can I change the size and font to Times New Roman of the xtickslabel that appear in the graphic? Thank you in advan
ax.XAxis.FontSize = 16; % or whatever ax.XAxis.FontName = 'Times New Roman';

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
x-axis values repeat themselves when I use tiledloyout for plots
The reason the xticklabels repeat is that there are fewer labels than there are ticks. Now, you may say, "How can that be? I set...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Separate numbers present within a cell on multiple rows
Take advantage of the second output of maxk, which is a vector of indices of the maxk values. CountArray = importdata("CountArr...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to draw multiple lines (plots) using semilogy() at once?
It is not necessary to resort to using eval to evaluate a list of arguments stored as a string. You can store the arguments in ...

fast 3 Jahre vor | 0

Beantwortet
Code for file processing
Here's one way to do it, with intermediate output along the way so you can follow along. % read the file str = readlines('stat...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
how set width column in table app designer
x = [{90} repmat({30},1,size(app.UITableFilteredTable.Data,2)-1)]; app.UITableFilteredTable.ColumnWidth = x;

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Select data from excel sheet from specific row to specific row
Here is one way to read that file and break its contents up by cykle: C = readcell('prow_KL_1.xlsx'); idx = find(cellfun(@is...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to change the color of the connections in plot to only one color?
To set the node labels, you can specify them with the 'Labels' input argument to circularGraph. To set the colormap, you can sp...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
How do I find the rows in one table that have certain string?
"I want to identify the rows in column 17 that contain 'Inactive'" % get the indicies of rows with "Inactive" STATUS: inactive...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Help in labelling Heatmap
To label the x- and y-axis, you can use xticklabels and yicklabels in this case. To highlight the diagonal elements, you can cr...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Title inside figure plot
Something like this? % a figure, red in color so it can be seen against the white background here: figure('Color','r') % so...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
How can i save an array in a txt file, with every number of the array in a different row?
Something like this? % a matrix M = magic(4) % write to file, using (:) to convert to column vector first writematrix(M(:),'...

fast 3 Jahre vor | 0

Beantwortet
How to change the name of a table and its headings?
The name of the table has to be a valid MATLAB variable name ("Time_duration_vehicle_speed" is OK; "Time duration vehicle speed"...

fast 3 Jahre vor | 0

Beantwortet
How to remove a single point from meshgrid?
First, notice that zero doesn't appear in x: x = linspace(-3,10); zero_x_idx = find(x == 0); zero_x_idx But if you used diff...

fast 3 Jahre vor | 1

Beantwortet
How to get rid of this nested for cycles?
I assume that you cannot change Q, and you need to calculate rev from Q. % simulating similar inputs: K = 3; H = 250; N = 50...

fast 3 Jahre vor | 1

Beantwortet
Grading multiple different but correct answers in MATLAB Grader
You can use ismember or ismembertol to check that the answer is among a set of acceptable answers.

fast 3 Jahre vor | 0

Beantwortet
Delete only one smithplot line
Note that the output from smithplot() is a Smith chart object, not a line object as is output from plot, so it makes sense that ...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Use of Interp to Interpret Data from a Table
Use interp1 instead of interp.

fast 3 Jahre vor | 1

Beantwortet
Plotting two non linear equations in same graph
Use element-wise operations (.^, ./, .*) t= linspace(0,1); y= linspace(0.5,1); [X, Y] = meshgrid(t, y); f1= @(t,y)(y - ((t.^...

etwa 3 Jahre vor | 1

Beantwortet
Location of legend on tiledlayout does not match with the plot
% some plots t = tiledlayout(3,3); for i = 1:9 nexttile(t) plot(rand(10,3)); end % make the legend leg = legend...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to put matrices defined earlier in "for loop" later
Instead of making 6 separate variables, you can put those 6 matrices in a single variable that you can index, e.g., a 3D array o...

etwa 3 Jahre vor | 1

Beantwortet
Is it possible to programmatically suppress figure roll-over menu (zoom, rotate, etc)?
From Axes Properties documentation: Data exploration toolbar, which is an AxesToolbar object. The toolbar appears at the top-ri...

etwa 3 Jahre vor | 0

Beantwortet
Error plotting distribution on top of pcolor
geoshow(sid.Longitude, sid.Latitude,sid.No_Individuals 'DisplayType', 'Point', 'Marker', 'o', 'Color', 'red'); % ...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
average of matrix cells
Here are a couple of guesses: 1. M = ones(7); M(2:end-1,2:end-1) = 2; M(3:end-2,3:end-2) = 3; M(4,4) = 4 cells1avg = mean(...

etwa 3 Jahre vor | 1

| akzeptiert

Beantwortet
How to add rows containing zeros to a matrix
Here's one way: % a 2x101 matrix a = rand(2,101) % append 4 rows of zeros a = [a; zeros(4,size(a,2))]

etwa 3 Jahre vor | 2

Mehr laden