Answered
Is there a smarter way to plot this polygon series?
If you have five datasets: for k = 1:5 data = load(['dataset',num2str(k),'.txt']); plot(data(:,1),data(:,2),'...

9 years ago | 0

| accepted

Answered
how to combine strfind and index in one line?
You could use |regexp| with the |'once'| option. For example, for this string: str = ['Soldiers! Don''t give yourselv...

9 years ago | 1

Answered
Using scatterm to plot points on Globe Projection of world map (spherical)
You pose the question well. I was able to replicate the problem. Here's a fix: mstruct = gcm; [x,y,z] = mfwdtran(mstru...

9 years ago | 0

| accepted

Answered
Write a MATLAB function that accepts as input a set of {
function myfunction(varargin) %MYFUNCTION accepts as input a set of { end

9 years ago | 0

Answered
Convert 1 min average data to hourly average data
If you can get time into datenum format, <https://www.mathworks.com/matlabcentral/fileexchange/48361-downsample-ts/content/downs...

9 years ago | 0

Answered
How to create a map of UK with circles plotted at certain locations?
Here's how you can do it with my <https://www.mathworks.com/matlabcentral/fileexchange/48122-circlem/content/circlem/html/circle...

9 years ago | 1

| accepted

Answered
How to read the RGB value from a grayscale image (just like the data cursor does)
Alternatively, I wrote a function for this a while back. It's been a while since I wrote it, so no guarantees regarding how wel...

9 years ago | 0

Answered
How to graph irrational functions
You can fix that error by including the |.| when you multiply or compute the exponent: k = (s-2)./(-s.^2-s+6); But noth...

9 years ago | 0

Answered
Inner loop not working
Perhaps you need to move the |b=0| after |i=1:1001|: for i=1:1001 b=0; for k=0:n

9 years ago | 1

Answered
How to Plot and graph
You'll have to create data arrays containing theta and V values. To get you started, theta = [0 20 45]; V = [12.7 15 ...

9 years ago | 1

| accepted

Answered
Is there a command or function to "autocorrect" words in a sentence? Such as correcting the sentence "Teh cow jumped over the mono." to "The" and "moon".
You could create a list of commonly misspelled words and corresponding correct spellings. For example, str = 'Teh cow...

9 years ago | 0

| accepted

Answered
comments line change automatically
Does my <https://www.mathworks.com/matlabcentral/fileexchange/53176-wraptext/content/wraptext/html/wraptext_documentation.html |...

9 years ago | 1

Answered
Overlap two pcolor with different color and set up transparency
What about this? % Some sample data: [X,Y,Z1] = peaks; Z2 = flipud(Z1); % Blue layer: p1 = surf(X,Y,z...

9 years ago | 1

| accepted

Answered
second order finite difference scheme
There's no need for the (t) when you define y(t). Same with dfdx. Also, make sure you change dfdx(1) in the loop to dfdx(i). ...

9 years ago | 0

| accepted

Answered
Trimimg a geotiff by a shapefile
You can use <https://www.mathworks.com/matlabcentral/fileexchange/46904-geoimread/content/html/geoimread_documentation.html |geo...

9 years ago | 1

| accepted

Submitted


imagescn
imagesc with transparent NaNs.

9 years ago | 2 downloads |

5.0 / 5
Thumbnail

Answered
Need to get the pixel values based on the directions(North, South,East,West) in to four arrays
Your question is not very clear. If I am interpreting your question correctly, Awest = A(3:8,4); Anorth = A(3,5:8); ...

9 years ago | 1

Answered
Concatenante struture contents into a new one
This'll do it: in.ID = [1,2,3,4,5]; in.names={'John','Peter','Rick','Mick','Pat'}; for k = 1:length(in.ID) ...

9 years ago | 0

Answered
Linear regression : estimate the parameters
Use <https://www.mathworks.com/help/matlab/ref/polyfit.html |polyfit|>. p = polyfit(x,y,1); beta1 = p(2); beta2 = ...

9 years ago | 0

| accepted

Answered
how to stop while loop by right mouse button click
From an <https://www.mathworks.com/matlabcentral/answers/51943-returning-which-button-was-pressed old answer by Jose-Luis>, ...

9 years ago | 0

Answered
I have a problem with fillm command using stereographic projection near boundary of longitude=0.
Ah, yes, I've encountered this problem before. This is a workaround: % Convert to map coordinates after calling axesm: ...

9 years ago | 0

| accepted

Answered
How can i amelirate the smooth of this curve ?
% Your data: rload=[100;1e3;10e3;100e3;1e6;10e6]; power_hs=[1.570642571; 15.23486212; 1.12E+02; 1.37E+02; 81.69126068; ...

9 years ago | 0

| accepted

Answered
Loops to determine what is in certain ranges from data
Renae: Given that you're new to Matlab, perhaps an explanation of Stephen's solution will help. First he created |X| as a rando...

9 years ago | 0

| accepted

Answered
Formatting the x-axis of a scatter plot
Indeed, the x values were left out, so it was plotting you ones and zeros on an x scale of 1 to 23, because you have 23 data poi...

9 years ago | 0

| accepted

Answered
hi, i'm trying to flip an image without any built in commands that is using for loops.
If you want to flip it vertically (equivalent to <https://www.mathworks.com/help/matlab/ref/flipud.html |flipud|>), you'd only n...

9 years ago | 5

Answered
Plot a 3D matrix for a three-dimensional object
Hi Yuzhen, Are the x and y values evenly spaced, or are they randomly scattered about? If the x and y values are evenly spac...

9 years ago | 1

Answered
which one will be for x_direction and y_direction
It is probable that the first column corresponds to x and the second column corresponds to y.

9 years ago | 0

| accepted

Answered
How do I enter the theta symbol?
Your question is unclear. Do you mean you want it in a title or a label? Try xlabel(' this is a theta \theta ')

9 years ago | 1

| accepted

Answered
How can I adjust the data aspect ratio in a plot with two y axes?
I'd set the limits of each axis individually, something like this: % some data: t = 1:12; T = 20*sin(pi*t/12); ...

9 years ago | 1

| accepted

Answered
mapprofile used on a projected map
If you have a 2D projected map and its corresponding x,y coordinates, you can use |interp2| to interpolate along any path you wi...

9 years ago | 0

Load more