photo

Xiaohan Du


Attivo dal 2016

Followers: 0   Following: 0

Statistica

  • First Review
  • Thankful Level 4

Visualizza badge

Feeds

Visto da

Domanda


How to increase contrast of a 3d plot? Should I set colorbar to log scale?
Hi all, I have the following code to plot a structure with y-displacement as ColorMapData ('node.mat', 'elem.mat', 'phiOri.ma...

circa 6 anni fa | 1 risposta | 0

1

risposta

Domanda


How to understand pdeplot3D?
Hi all, I'm trying to run this example from help of function pdeplot3D: structuralmodel = createpde('structura...

circa 6 anni fa | 1 risposta | 0

1

risposta

Domanda


Sort cells order according to their values?
Hi all, I have a function produces a cell like this: K>> otpt{:} ans = 3 0 2 1 ans = ...

circa 6 anni fa | 1 risposta | 0

1

risposta

Domanda


Logscale x axis of stacked bar chart, how to make the chart shows clearer results?
Hi all, I have some data, and I'd like to plot them into horizontal bar charts with log scale on x-axis. I wrote some code li...

circa 6 anni fa | 0 risposte | 0

0

risposte

Domanda


L2 norm or Frobenius norm?
Hi all, I read that Matlab norm(x, 2) gives the 2-norm of matrix x, is this the L2 norm of x? Some people say L2 norm is squa...

circa 6 anni fa | 2 risposte | 0

2

risposte

Domanda


Measure performance of 2 programmes
Hello, I have 2 codes codeOld and codeNew, each contains many methods (i.e. both very complex). I'd like to prove that codeNe...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


Add elements of array A to array B and ensure there is no repeated element in B?
Hi all, If I have arrays A and B, and I'd like to add elements of array A into array B, during this process, B is actively ch...

oltre 6 anni fa | 2 risposte | 0

2

risposte

Domanda


Can I recover only the diagonal elements of A' * B with SVD vectors of A and B?
Hi all, Imagine I have 2 matrices A and B and I need the diagonal elements of (A' * B). If say A and B are both m*n matrices ...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


How to calculate trace(A' * B) using SVD vectors of A and B?
Hi all, Imagine I have 2 large matrices which have more rows than columns, I'd like to calculate trace(A' * B) for N times. I...

oltre 6 anni fa | 2 risposte | 0

2

risposte

Domanda


How to plot a mesh with colors like contour?
Hi all, I have a mesh information including deformation, nodes and connectivity. Now I'd like to visualize it with a coloured...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


Which one is faster: trace(a' * b) or sum(sum(a .* b', 2))?
Hi all, If I have 2 matrices with same size, I first perform SVD to each, then calculate the trace differently as follows: ...

oltre 6 anni fa | 2 risposte | 0

2

risposte

Domanda


How to improve the speed of computing trace in my code?
Hi all, In my code there is a key function which cost the majority of computational power due to the large number of repetiti...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


Use logical values to extract a matrix not a vector?
Hi all, I have a matrix like this: M = 6 2 9 7 2 3 9 3 ...

oltre 6 anni fa | 3 risposte | 0

3

risposte

Domanda


How to find the indices within blocks and sort the blocks thereafter?
Hi all, Say I have the following matrix contains 15 elements: M = 6 2 9 7 ...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


Operations between every 2 different elements in a cell?
Hi all, I have a cell like this: K>> ur ur = 4×3 cell array {[1]} {'-1 -1'} {1×201 cell...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


How to set the xy blocks in SURF plot as squares?
Hi all, I have a set of x,y,z data as follows: x = 0.1 0.31623 1 3.1623 10 y = -1 -0...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


Problem with XTick: location of XTick doesn't match data.
Hi all, I have the following script to plot 2 curves with 2 x-axis on top and bottom: clear; clc; clf; errxOri = [4 6...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


For 2 curves, how to have xticks on both the above and below of x-axis?
Hi all, I plot the attached figure using this code clear; clc; x1 = [1 3 5 7]; x2 = [1 2 4 7]; data1 = [...

oltre 6 anni fa | 2 risposte | 0

2

risposte

Domanda


Determine if a value has changed after some operations?
Hi all, How can I determine if a value has changed or not after some operations? For example: testA = valueA; % aft...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


Is it necessary to store column vectors in a column order in cells?
Hi all, I know MATLAB stores data in a column-major order (see <https://uk.mathworks.com/help/matlab/matlab_external/matlab-d...

oltre 6 anni fa | 0 risposte | 0

0

risposte

Domanda


How to view the command window history?
Hi all, If there is a long command being executed and result being displayed, MATLAB does not show the full history in the c...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


How to improve speed of calculating trace in a script?
Hi all, In my project I have to calculate the trace of some matrix products, I have the following script to demonstrate the p...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


Compare and find multiple matching strings
Hi all, I have a text file (.inp) from Abaqus, where I need to find the line number of some strings. I read the file using 'f...

oltre 6 anni fa | 2 risposte | 0

2

risposte

Domanda


What's the best way to add semi-colons after each element of a matrix?
Hi all, I have a cell matrix which contains strings like this (showing part of the cell, actual cell can be quite large): ...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


How to define the output path of THE "system" command
Hi all, I use Matlab script to call Abaqus. The command I use is: system('/home/xiaohan/abaqus/6.14-1/code/bin/abq6141 n...

oltre 6 anni fa | 0 risposte | 0

0

risposte

Risposto
Write multi-line strings into text file?
found an answer here: <https://uk.mathworks.com/matlabcentral/answers/195207-saving-cell-array-and-string-to-text-file> co...

oltre 6 anni fa | 0

| accettato

Domanda


Write multi-line strings into text file?
Hi all, I have a few lines of strings, which I'd like to write into a .inp (basically a text) file. The strings look like thi...

oltre 6 anni fa | 3 risposte | 1

3

risposte

Domanda


Str2num: exact the same conversion
Hi all, Quick question: I have a string like this: rawStrMod = '0.0000000001, 0.3' I use str2num to convert it to nu...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


Difference between these 2 operations: D = M' * M then P' * D * P and P' * (M' * M) * P.
Hi all, Imagine I have M = rand(N, N); P = rand(N, 3); where N is a VERY large scalar, then for these 2 functions:...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Domanda


Figure legend: how to prevent entries from showing?
Hi all, My code plots a figure with a few curves, after the code finishes running, I manually add the legend like this: ...

quasi 7 anni fa | 2 risposte | 0

2

risposte

Carica altro