Community Profile # Chunru

Last seen: Today Active since 2013

Matlab user since 1990

#### Statistics

All
• • • • • • • • • • • • #### Content Feed

View by

How can I only select table data from a text file.

etwa 4 Stunden ago | 0

Removing commas between columns in text data
test = {'Sometimes, ,, I, use, commas, .' 'I, like, writing, ,, I, like, reading'}; test = regexprep(test, ',\s', ' ') ...

ein Tag ago | 0

Show limited digits numbers.
You can use fprintf with format specifier to format the print out. "doc fprintf". A=2.54357766; fprintf('%.6f\n', A);

ein Tag ago | 0

Change string words to number in table
% Assume the column has the data x.omst=["Clouds"; "Rain"; "Clear"] % You can use the categorical data x.omst = categorical(x...

2 Tage ago | 0

| accepted

Deleting unnecessary values in numerical array
% Assume that your data in second column is sorted. x = [ 1420 1 1410 1 1400 1 1390 0.9 1380 0.8 1370 0.7 1300 0 1290 0...

2 Tage ago | 0

| accepted

99x99 matrix
% For time comparison: n = 1000; timeit(@() bidiag1(n)) timeit(@() bidiag2(n)) timeit(@() bidiag3(n)) function bidiag1(n)...

2 Tage ago | 0

99x99 matrix
n = 9; %99 A = eye(n); A(n:n-1:n*n-1) = 1; % anti-diagonal A

3 Tage ago | 0

How can I generate a square lattice undirected graph?
n = 10; A = delsq(numgrid('S',n+2)); G = graph(A,'omitselfloops'); h = plot(G); h.XData = floor((0:99)/10); h.YData = rem((...

3 Tage ago | 0

| accepted

add an line for the coasts of the continents used for the geodensityplot in the mapping toolbox
mapping toolbox has the convention of lat-lon coordinates rather than lon-lat. try the following in your code: lon = linspace(...

3 Tage ago | 0

| accepted

How can I add more colors to semilogy?
plot(rand(30,20)+(1:20)); % plot 20 lines legend % The following line will change the default ColorOrder (7 colors) % change...

5 Tage ago | 0

how to change the front size and the inclination in a bar graph
h = gca; h.XTickLabelRotation = 0; % not recommended for long string h.TickLabelInterpreter = 'none';

5 Tage ago | 0

How do i remove conj from differention?
clear all syms x v s a y z r t real syms x(t) y(t) assumeAlso([y(t),x(t)],'real') A=[x, diff(y(t),t), s; y, z, r; s x(...

6 Tage ago | 0

| accepted

How to change the values of both axes
%Define variables sigma = 35*10^6; young_modulus = 90*10^9; strain_coefficient = 6*10^-9; magnetic_field = linspace(0, 16000...

6 Tage ago | 0

Selecting files from a directory
sims = pwd; %uigetdir ('C:\Matlab') save test.in sims % create a file info = dir(fullfile(sims,'*.in')) list = {info(~[info...

6 Tage ago | 0

| accepted

fit function does not work correctly
If the StartPoint is good enough, you can get the correct fitting. t = [0:0.01:6]'; %Test with a cosinus function y = cos(t*3...

6 Tage ago | 0

Display values of each element in imagesc
c = randi([0 40], [16 16]); heatmap(c); colormap(jet(512))

7 Tage ago | 0

| accepted

How to plot this frequency graph?
load runoff load precipitation precipitation = normalize(precipitation, 'range'); runoff = normalize(runoff, 'range'); histo...

7 Tage ago | 1

| accepted

How can I extract the values form the cell array?
Obviously, you don't have a matlab cell array (is it a python array?). The matlab array may look like the following: a(1).name...

7 Tage ago | 0

| accepted

Find the index of a value closest to a constant value in 3D array when the index of row and column are given
B(:,:,1) =[ 1 2 4 2 7 8 9 0]; B(:,:,2) =[ 9 2 4 7 0 1 2 ...

8 Tage ago | 0

| accepted

Sparse Matrix with Same number of non-zero values in each column
A = createMatrix(8, 4); full(A) function A = createMatrix(n, k) A = sparse(n,n); for i=1:n A(randperm(n, k), i) = 1/k; ...

8 Tage ago | 0

| accepted

Displaying frames captured by getframe(h) at original size
You can use "imshow" which by default show images in 100% magnification. "doc imshow" for more details.

10 Tage ago | 0

| accepted

using imagesc to plot a matrix of data
%C = 0.1:0.1:0.2; C = [0.1 0.2]; % There are only two points along x F = 0.1:0.1:0.5; figure(1) subplot(1,3,1) mean_GT...

10 Tage ago | 0

| accepted

How to create a circle filled with equidistant points inside it?
Here is a sub-optimal (or almost optimal) solution. Filled dots will form the hexagonal formation. radius = 10; d = 1; % dis...

10 Tage ago | 0

| accepted

How I plot a matrix wich each rows is a different curves on the graph?
a = randn(6, 21); plot(a')

11 Tage ago | 0

| accepted

How to Convert Magnitude(g/N)/Phase (degrees) data in to Complex Receptance (m/N)
x =[0.00000e+000 1.16597e+002 -1.80000e+002 3.12500e-001 9.33462e+001 5.02240e+001 6.25000e-001 ...

12 Tage ago | 0

3D Plot of a Matrix with only Char data type
x= {'USA', 'Germany', 'South Africa', 'China', 'Mexico', 'Australia'}; y = {'America', 'Europe', 'Africa', 'Asia', 'South Amer...

13 Tage ago | 0

Massive time required for pdist
%tic X = rand(1000,2); Y = rand(1000,2); % fprintf('Time for array creation: '); %toc %% Version 1 tic j=1; for i = ...

13 Tage ago | 0

| accepted

How to arrange the constraints shape to A matrix and b constants automatically ( Ax <= b)??
% Let x = [x1; x2; x3; x4] % x1 + x2 <= x3 + x4 + 1 ; % constraint 1 % => [1 1 -1 -1]*x <= 1 % X3 <= x1 + 10 ; % cons...

16 Tage ago | 0