1

What i'm trying to achieve is something like

variable = 2000
imwrite(x,'xx\xx\name'+variable+'.tif','Compression','none');

Is there a way to achieve this in matlab?

costabrava
  • 15
  • 7
  • You can concatenate char arrays with `['xx\xx\name' num2str(variable) '.tif']`. Note the use of `num2str` to convert the number to a char array. – rinkert Nov 25 '20 at 14:45
  • are you sure we dont need anything else? Like that it give me this error: Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses. – costabrava Nov 25 '20 at 14:47
  • if you _exactly_ copy what I wrote, it should work. You probably miss the first `[` – rinkert Nov 25 '20 at 14:49
  • When i try to put what you suggested it tell me on num2str(variable): invalid syntax A (') might be missing a closing ')' – costabrava Nov 25 '20 at 14:55
  • I'm a dumb, i didnt put the space between 'xxx\name' and num2str...ty! it worked! – costabrava Nov 25 '20 at 14:56

0 Answers0