The img file I have is retrieved from arcgis.How can I open and read it?
MATLAB: How to read img file in matlab
.img filearcgisMapping Toolbox
Related Solutions
First lets find the strings that are common to all cell arrays:
listA={'India','Iran','Ireland','Israel','Jordan','Kuwait','Lebanon','Lesotho','Libya','Luxembourg','Malawi','Maldives','Morocco','Nepal','Netherlands','Norway','Oman','Paraguay','Peru','Philippines',};listB={'Denmark','El Salvador','Gabon','Gambia','Lebanon','Lesotho','Libya','Luxembourg','Malawi','Maldives','Morocco','Nepal','Netherlands','Norway','Oman','Paraguay','Peru','Philippines','Qatar','Rwanda','Saudi Arabia','Senegal','Singapore','Sudan'};listC={'Kuwait','Lebanon','Lesotho','Nepal','Netherlands','Oman','Sweden','Syria','Tanzania','Turkey','Uruguay'};%
lists = {listA,listB,listC}; % storing data together makes working with them much simpler.
%exc = lists{1};for k = 2:numel(lists) exc = intersect(exc,lists{k});end
giving the strings found in all cell arrays as:
exc = 'Lebanon' 'Lesotho' 'Nepal' 'Netherlands' 'Oman'
Now we can easily get the input cell arrays with the strings from exc removed:
out = cell(size(lists));for k = 1:numel(lists) out{k} = setdiff(lists{k},exc);end
giving:
>> out{:}ans = 'India' 'Iran' 'Ireland' 'Israel' 'Jordan' 'Kuwait' 'Libya' 'Luxembourg' 'Malawi' 'Maldives' 'Morocco' 'Norway' 'Paraguay' 'Peru' 'Philippines'ans = 'Denmark' 'El Salvador' 'Gabon' 'Gambia' 'Libya' 'Luxembourg' 'Malawi' 'Maldives' 'Morocco' 'Norway' 'Paraguay' 'Peru' 'Philippines' 'Qatar' 'Rwanda' 'Saudi Arabia' 'Senegal' 'Singapore' 'Sudan'ans = 'Kuwait' 'Sweden' 'Syria' 'Tanzania' 'Turkey' 'Uruguay'
And if you want a list of all strings together, excluding those in exc:
uni = {};for k = 1:numel(lists) uni = union(uni,lists{k});enduni = setdiff(uni,exc)
gives:
uni = 'Denmark' 'El Salvador' 'Gabon' 'Gambia' 'India' 'Iran' 'Ireland' 'Israel' 'Jordan' 'Kuwait' 'Libya' 'Luxembourg' 'Malawi' 'Maldives' 'Morocco' 'Norway' 'Paraguay' 'Peru' 'Philippines' 'Qatar' 'Rwanda' 'Saudi Arabia' 'Senegal' 'Singapore' 'Sudan' 'Sweden' 'Syria' 'Tanzania' 'Turkey' 'Uruguay'
[boston, R] = geotiffread('boston.tif');
Here, R contains the spatial reference object.
R = MapCellsReference with properties: XWorldLimits: [764317.995579396 779019.409746063] YWorldLimits: [2951122.28480912 2960574.36564245] RasterSize: [2881 4481] RasterInterpretation: 'cells' ColumnsStartFrom: 'north' RowsStartFrom: 'west' CellExtentInWorldX: 3.28083333333333 CellExtentInWorldY: 3.28083333333333 RasterExtentInWorldX: 14701.4141666667 RasterExtentInWorldY: 9452.08083333332 XIntrinsicLimits: [0.5 4481.5] YIntrinsicLimits: [0.5 2881.5] TransformationType: 'rectilinear' CoordinateSystemType: 'planar'
Best Answer