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

casi 3 años hace | 1

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 1

| aceptada

Respondida
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';

casi 3 años hace | 1

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

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

casi 3 años hace | 1

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 1

| aceptada

Respondida
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(:),'...

casi 3 años hace | 0

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

casi 3 años hace | 0

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

casi 3 años hace | 1

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

casi 3 años hace | 1

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

casi 3 años hace | 0

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 1

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

alrededor de 3 años hace | 1

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

alrededor de 3 años hace | 0

| aceptada

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

alrededor de 3 años hace | 1

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

alrededor de 3 años hace | 0

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

alrededor de 3 años hace | 0

| aceptada

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

alrededor de 3 años hace | 1

| aceptada

Respondida
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))]

alrededor de 3 años hace | 2

Cargar más