Beantwortet
How do I plot piecewise defined functions in different colours.
myFun = @(x) ((x<=100).*(0.5 .* x)) + ((x>100 & x<=200) .* (50+0.2.*(x-1000))) + ((x>200).*(75+(0.5.* x))); fplot(myFun,...

mehr als 6 Jahre vor | 0

Beantwortet
How I can change the legend of a graph from vertical to horizontal
plot(rand(10,3)); legend({'a','b','c'},'Orientation','horizontal'); Please read the <https://se.mathworks.com/help/matlab/...

mehr als 6 Jahre vor | 4

| akzeptiert

Beantwortet
Help, How can I write the symbol " theta" in Matlab
aH = axes; plot(rand(10,1)); aH.XLabel.Interpreter = 'Latex'; aH.XLabel.String = '$\theta$';

mehr als 6 Jahre vor | 2

Beantwortet
How remove NaN values in all Matrices in Cell
This will get rid of the entire row if there is a NaN: c{1}= [1 1 1; 2 2 2; 3 3 3; ...

mehr als 6 Jahre vor | 1

| akzeptiert

Beantwortet
How to plot histograms of two different classes in a single plot?
histogram(rand(100,1)); hold on histogram(rand(100,1)-2,'FaceColor','r');

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
I want to copy some data
a = [2 3 4; 6 2 3; 9 8 3]; idx = ndgrid(1:3,1:4)'; result = a(idx(:),:) *Edit:* Felt the nagging need for a one-liner...

mehr als 6 Jahre vor | 0

Beantwortet
Obtaining the chi square value from a multigaussian fit
Provided you have the right toolbox: <https://se.mathworks.com/help/stats/chi2gof.html> Otherwise, use the residuals of yo...

mehr als 6 Jahre vor | 0

Beantwortet
Error reading .mrc file
ReadMRC('sample.mrc')

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
how to convert text to speech
<https://se.mathworks.com/matlabcentral/fileexchange/18091-text-to-speech> <https://se.mathworks.com/matlabcentral/answers/32...

mehr als 6 Jahre vor | 0

Beantwortet
Get CPU and memory usage
<https://stackoverflow.com/questions/25950727/show-cpu-cores-utilization-in-matlab>

mehr als 6 Jahre vor | 1

| akzeptiert

Beantwortet
How can change transparency and thickness of a line in Matlab
Provided you have a reasonably recent version of Matlab: p1 = plot(rand(10,1),'r-','LineWidth',5); hold on p2 = plot(rand(...

mehr als 6 Jahre vor | 14

| akzeptiert

Beantwortet
How can I concatenate two string vectors 5x1 and 1x18 to get a 5x18 text matrix
Currencies = {'ARS','BRL','CLP','COP','CZK'}; % et cetera Criteria = {'TR';'YC';'SPR';'SS'}; result = cellfun(@(x,y) [x,...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
plot3 temperature color
Looks like you are looking for <https://se.mathworks.com/help/matlab/ref/scatter3.html _scatter3()_>.

mehr als 6 Jahre vor | 0

Beantwortet
Randomizing the rows of a matrix and reversing
If you want to return to the original matrix, you need to keep it. There is no way to _undo_ a random permutation, unless your d...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
Sparse matrix in optimization
Looping is one way to go. i = [900 1000]; j = [900 1000]; v = [10 100]; S = sparse(i,j,v,1500,1500) for ii = [i;j] ...

mehr als 6 Jahre vor | 0

Beantwortet
Populate columns of matrix without for loop using input from a vector of intergers
X=[0, 2, 1, 2, 3]; numCols = max(X) + 1; result = zeros(numel(X),numCols); idx = sub2ind(size(result),1:numel(X)...

fast 7 Jahre vor | 0

| akzeptiert

Beantwortet
Why do i get error 'No supported compiler or SDK was found' when i use mex -setup?
Are you sure it's <https://se.mathworks.com/support/compilers.html supported>? Down to the version number.

fast 7 Jahre vor | 0

Beantwortet
How to compare some specific entries of a matrix, if I have their indices stored in 2 files?
idx = sub2ind(size(C), A, B) result = max(C(idx));

fast 7 Jahre vor | 0

| akzeptiert

Beantwortet
Extract group of identical values from an array
If you have the image-processing toolbox. <https://se.mathworks.com/help/images/ref/bwconncomp.html#outputarg_CC bwconncomp()...

fast 7 Jahre vor | 0

| akzeptiert

Beantwortet
how to plot scatterplot for one attribute?
data = rand(10,1); figure plot(data); %implicit figure plot(1:size(data,1), data); %explicit Please read the docum...

fast 7 Jahre vor | 0

Beantwortet
How to find all Linux command
Not sure if all, but you can always use the <https://se.mathworks.com/help/matlab/ref/unix.html _unix()_> function.

fast 7 Jahre vor | 0

Beantwortet
To put score value based on neighbor column position value in same row
idx = cellfun(@(x) ~isempty(x), funct(:,1:2:end); fillMat = repmat([0:-1:-(size(funct,1)+1)]',1,numel(1:2:size(funct,2))) .* ...

fast 7 Jahre vor | 1

Beantwortet
how to reverse cell elements from left to right
cellfun(@(x) {fliplr(x)},a)

fast 7 Jahre vor | 0

| akzeptiert

Beantwortet
Find the precision of a value
Just in case your number is stored as a string: bla = '5.14'; result = strsplit(bla,'.'); result = numel(result{2}) T...

fast 7 Jahre vor | 1

Beantwortet
How to plot partial results of a for-loop in one figure and create different figures for other results?
<https://se.mathworks.com/help/matlab/ref/subplot.html subplot()>

fast 7 Jahre vor | 1

| akzeptiert

Beantwortet
How do I quiver plot magnetic field
You could use <https://se.mathworks.com/help/matlab/ref/quiver3.html quiver3()>.

fast 7 Jahre vor | 0

Beantwortet
How to get all possible combinations of data in a cell?
data = {{'A', 'B', 'C', 'D'}; ... {'E','F',};... {1, 2, 3, 4};... {5, 6, 7}}; cell_size = cellfun(@(x) size(x,...

etwa 7 Jahre vor | 1

Beantwortet
How can i measure the distance between points in a scatter graph
<https://se.mathworks.com/help/stats/pdist.html pdist()> with the _'cityblock'_ argument should do the trick.

etwa 7 Jahre vor | 0

Beantwortet
How to plot a surface in its parametric form ?
You don't need to use _meshgrid()_ if you have the _symbolic math_ toolbox. <https://se.mathworks.com/help/symbolic/mupad_ref...

etwa 7 Jahre vor | 0

Beantwortet
Plotting a linear function to a surface: how interpolate to obtain smooth curves, instead of linear lines?
What are you trying to achieve? Just setting the _EdgeColor_ property to _None_ might make it _look_ smoother. Also, you can ...

etwa 7 Jahre vor | 0

Mehr laden