답변 있음
plot of markers, having different color in one line of code.
x2=[1,3]; y2=[3,4]; x3=[3,4,5]; y3=[1,6,7]; cell_values={x2,y2;x3,y3}; col_vals={[0.500 0.3250 0.0500],[0.8500 0.3250 0.0...

대략 3년 전 | 0

| 수락됨

답변 있음
How to evaluate an algebraic expression at a certain point when it is in a matrix?
You can use matlabFunction to create an anonymous function, which will eventually help to calcuate the values at specific x1 and...

대략 3년 전 | 1

| 수락됨

답변 있음
How to open a cell array??
out=zeros(length(result_pettitt),max(cellfun(@(x) length(x), result_pettitt))); for kk=1:length(result_pettitt) out(kk,1:l...

대략 3년 전 | 1

| 수락됨

답변 있음
Deleting the same empty row in 2 different column vectors - then searching a value giving the other column vector result
load_mapping_csv Mapping_refine=Mapping(~strcmp(Mapping(:,3),'[]'),[1:3]); The script of load_mapping_csv is attached, and has...

대략 3년 전 | 0

| 수락됨

답변 있음
Colorbar font size decreases upon export
Instead of manually saving the figure, you can prefer to save figure by command. It won't shrink the figure. print('sample','-d...

대략 3년 전 | 0

| 수락됨

답변 있음
Copy the same rows from multiple identical files to a single file
Sicne you have not attached any sample file, I am using a file having 5 rows, and extracting 2nd and 5th rows from these. Attach...

대략 3년 전 | 1

| 수락됨

답변 있음
Subtract a different number from every group n of values in a table
You can use reshape to perform operations: data=randi(20,1,1728000); B=reshape(data,36000,[]); B=B-ones(size(B,1),size(B,2))....

대략 3년 전 | 0

답변 있음
How to plot a tiled layout using a loop?
for r = 1:10 subplot(2,5,r) plot(randi(10,5,5),'ro') end If you have two loops, you can use as follows: for r = 1...

대략 3년 전 | 2

| 수락됨

답변 있음
matrix inverse, swap columns and rows
This looks like a homework problem. Here are some hints you can use it: A = randi([-10,10],5,10) %for swapping rows A([1 2]...

대략 3년 전 | 0

| 수락됨

답변 있음
Is it possible to reduce the alpha for markers in a simple plot?
Plot function doesn't have support to tune transparency. You can use scatter to do that scat = scatter(x,y,'MarkerFaceColor','b...

대략 3년 전 | 0

| 수락됨

답변 있음
Find element satisfying condition in 3D array, then apply operation to all elements in the column number
" I want to find all the elements that satisfy a certain condition in A (e.g. A<0). ": I hope you mean to find the indices of th...

대략 3년 전 | 1

| 수락됨

답변 있음
How can I concatenate a row vertically every 5 cells?
You can use reshape command to do that. A=randi(20,1,100); reshape(A,20,5); reshape(A,20,5); It reshapes along the column of...

대략 3년 전 | 0

| 수락됨

답변 있음
Generate a plot set
for kk=1:65 f=figure plot(randi(10,5,5)) print(sprintf('figure_%d',kk),'-djpeg','-r100') close(f) end

대략 3년 전 | 0

답변 있음
Optimization problem for trigonometric functions
If k, lo, r1, and r2 are constants, you can use anonymous function to calculate the expression: k=randi(10,1,1); lo=randi(10...

대략 3년 전 | 0

답변 있음
find the smallest value of the surface area A in the vector A and the corresponding values of x and y in the vectors x and y.
You can simply use boolean function to find the location of minimum surface area, and subsquently use the same index to get the ...

대략 3년 전 | 0

답변 있음
How to plot a horizontal line between two arrays?
Question is not clear. Quoting on a part of your question, " flat line for A(1)=5 at a Y of 1 extended to B(1)=10 at the same Y"...

대략 3년 전 | 0

| 수락됨

답변 있음
Getting a number of different outputs using a single function
I have changed just the index where you are saving the output. Focussing on "And if I have n=2, then I should have ExDataout(...

대략 3년 전 | 0

답변 있음
Continuous execution of vertical line for set of data
"I want to plot a vertical line at each of these values. ". The array you provided is 1D array. You will get 1 line plot out of ...

대략 3년 전 | 0

| 수락됨

답변 있음
How to search through Data in a Matrix to find a specific element using For Loops and if statements?
Why do you wish to use for and if for searching the locations of SE? You can use without using for and if, and it would be very ...

대략 3년 전 | 0

| 수락됨

답변 있음
Selective columns from multiple text folders
Since you have not attached a text file, I just put a sample text file having multiple rows in multiple folders, and use the be...

대략 3년 전 | 0

답변 있음
Merge columns and export to a text file
Focusing on "I need to convert it to the .txt (MS-DOS) in this form:" in your question, this chunck of code might help you. AB ...

대략 3년 전 | 1

| 수락됨

답변 있음
Multiple inputs/outputs of a function
You can use the same function which you provided, and use loop while calling the function, or you can modify the function to giv...

대략 3년 전 | 0

| 수락됨

답변 있음
Error using plot Invalid data argument (Data from Excel)
You can generate dates as per the values in the excel sheet. This won't throw an error for dimension mismatch. [~, ~, weather_d...

대략 3년 전 | 0

| 수락됨

답변 있음
Deleting specific rows in a matrix
A=[120 150 200 250 300 350 420 450 0 0 100 400 450 0 420] index=find(nanmean(A==0,2...

대략 3년 전 | 0

| 수락됨

답변 있음
When i covert a structure to cell array, my fieldNames disappear
"Is there a way to have both field and values on the cell array?" Let us create a sample structure S.x = linspace(0,4*pi); S....

대략 3년 전 | 0

답변 있음
How to plot an average of two netcdf variables from different files?
If you have multiple netcdf files in a folder, and wish to take mean of SST, you can have a for loop to read the values, and sub...

대략 3년 전 | 1

| 수락됨

답변 있음
Does cell2mat work in Matlab 2019?
It is working well for me. C = {[1], [2 3 4]; [5; 9], [6 7 8; 10 11 12]} A = cell2mat(C) 1 2 3 4 ...

대략 3년 전 | 0

답변 있음
Trying to add color gradient to patch(isosurface))
Not sure about the exact what you wish to plot. But you can give it a try to plot using imagesc, use the gray colormap to plot. ...

대략 3년 전 | 0

답변 있음
Predetermine axis limits without plotting
You can give it a try to add small value to the maximum value of the array. It can either be 10% or 20% of the extreme. x_vals...

대략 3년 전 | 0

답변 있음
how to find derivative of a function and ploting the surface of function and its derivative
In order to plot a surface, you can use the below commands: [X,Y] = meshgrid(1:0.5:10,1:20); Z = sin(X) + cos(Y); surf(X,Y,Z)...

대략 3년 전 | 1

더 보기